]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/lint-temporary-cstring-as-param.rs
Rollup merge of #87180 - notriddle:notriddle/sidebar-keyboard-mobile, r=GuillaumeGomez
[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 }