Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwhit committed Oct 27, 2020
1 parent 39941e6 commit 572cd35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/test/ui/lint/lint-temporary-cstring-as-param.rs
Original file line number Diff line number Diff line change
@@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/lint/lint-temporary-cstring-as-param.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 572cd35

Please sign in to comment.