• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #![deny(temporary_cstring_as_ptr)]
2 
3 use std::ffi::CString;
4 use std::os::raw::c_char;
5 
some_function(data: *const c_char)6 fn some_function(data: *const c_char) {}
7 
main()8 fn main() {
9     some_function(CString::new("").unwrap().as_ptr());
10     //~^ ERROR getting the inner pointer of a temporary `CString`
11 }
12