2020-09-22 15:20:06 +00:00
|
|
|
// this program is not technically incorrect, but is an obscure enough style to be worth linting
|
2020-08-23 18:21:58 +00:00
|
|
|
#![deny(temporary_cstring_as_ptr)]
|
2020-08-18 16:09:33 +00:00
|
|
|
|
|
|
|
use std::ffi::CString;
|
|
|
|
|
2023-04-04 18:31:25 +00:00
|
|
|
macro_rules! mymacro {
|
|
|
|
() => {
|
|
|
|
let s = CString::new("some text").unwrap().as_ptr();
|
|
|
|
//~^ ERROR getting the inner pointer of a temporary `CString`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-18 16:09:33 +00:00
|
|
|
fn main() {
|
2020-10-26 23:19:06 +00:00
|
|
|
let s = CString::new("some text").unwrap().as_ptr();
|
|
|
|
//~^ ERROR getting the inner pointer of a temporary `CString`
|
2023-04-04 18:31:25 +00:00
|
|
|
mymacro!();
|
2020-08-18 16:09:33 +00:00
|
|
|
}
|