diff --git a/src/test/ui/lint/lint-temporary-cstring-as-param.rs b/src/test/ui/lint/lint-temporary-cstring-as-param.rs index 2d40f6e871d9f..9f5805367e43d 100644 --- a/src/test/ui/lint/lint-temporary-cstring-as-param.rs +++ b/src/test/ui/lint/lint-temporary-cstring-as-param.rs @@ -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()); diff --git a/src/test/ui/lint/lint-temporary-cstring-as-param.stderr b/src/test/ui/lint/lint-temporary-cstring-as-param.stderr index c72d56f2a5fca..0a9e5a4bf4aa5 100644 --- a/src/test/ui/lint/lint-temporary-cstring-as-param.stderr +++ b/src/test/ui/lint/lint-temporary-cstring-as-param.stderr @@ -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