Files
rust/src/test/ui/lint/lint-temporary-cstring-as-param.rs

11 lines
233 B
Rust
Raw Normal View History

2020-09-21 16:32:28 -04:00
#![deny(temporary_cstring_as_ptr)]
use std::ffi::CString;
fn some_function(data: *const i8) {}
fn main() {
2020-10-26 19:19:06 -04:00
some_function(CString::new("").unwrap().as_ptr());
//~^ ERROR getting the inner pointer of a temporary `CString`
2020-09-21 16:32:28 -04:00
}