mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-23 13:13:17 +00:00
Fix test
This commit is contained in:
parent
39941e6281
commit
572cd358d3
@ -1,8 +1,9 @@
|
||||
#![deny(temporary_cstring_as_ptr)]
|
||||
|
||||
use std::ffi::CString;
|
||||
use std::os::raw::c_char;
|
||||
|
||||
fn some_function(data: *const i8) {}
|
||||
fn some_function(data: *const c_char) {}
|
||||
|
||||
fn main() {
|
||||
some_function(CString::new("").unwrap().as_ptr());
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: getting the inner pointer of a temporary `CString`
|
||||
--> $DIR/lint-temporary-cstring-as-param.rs:8:45
|
||||
--> $DIR/lint-temporary-cstring-as-param.rs:9:45
|
||||
|
|
||||
LL | some_function(CString::new("").unwrap().as_ptr());
|
||||
| ------------------------- ^^^^^^ this pointer will be invalid
|
||||
|
Loading…
Reference in New Issue
Block a user