Skip to content

Commit 572cd35

Browse files
committed
Fix test
1 parent 39941e6 commit 572cd35

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#![deny(temporary_cstring_as_ptr)]
22

33
use std::ffi::CString;
4+
use std::os::raw::c_char;
45

5-
fn some_function(data: *const i8) {}
6+
fn some_function(data: *const c_char) {}
67

78
fn main() {
89
some_function(CString::new("").unwrap().as_ptr());

src/test/ui/lint/lint-temporary-cstring-as-param.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: getting the inner pointer of a temporary `CString`
2-
--> $DIR/lint-temporary-cstring-as-param.rs:8:45
2+
--> $DIR/lint-temporary-cstring-as-param.rs:9:45
33
|
44
LL | some_function(CString::new("").unwrap().as_ptr());
55
| ------------------------- ^^^^^^ this pointer will be invalid

0 commit comments

Comments
 (0)