]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/lint-temporary-cstring-as-param.rs
Merge commit 'f2cdd4a78d89c009342197cf5844a21f8aa813df' into sync_cg_clif-2022-04-22
[rust.git] / src / test / ui / lint / lint-temporary-cstring-as-param.rs
1 #![deny(temporary_cstring_as_ptr)]
2
3 use std::ffi::CString;
4 use std::os::raw::c_char;
5
6 fn some_function(data: *const c_char) {}
7
8 fn main() {
9     some_function(CString::new("").unwrap().as_ptr());
10     //~^ ERROR getting the inner pointer of a temporary `CString`
11 }