mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
12 lines
263 B
Rust
12 lines
263 B
Rust
#![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`
|
|
}
|