summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lint/lint-temporary-cstring-as-param.rs
blob: 9f5805367e43d098caed0f899d75795302f769c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
#![deny(temporary_cstring_as_ptr)]

use std::ffi::CString;
use std::os::raw::c_char;

fn some_function(data: *const c_char) {}

fn main() {
    some_function(CString::new("").unwrap().as_ptr());
    //~^ ERROR getting the inner pointer of a temporary `CString`
}