mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 04:56:25 +03:00
Fix test
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user