]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/lint-temporary-cstring-as-ptr.rs
Merge commit 'e9d1a0a7b0b28dd422f1a790ccde532acafbf193' into sync_cg_clif-2022-08-24
[rust.git] / src / test / ui / lint / lint-temporary-cstring-as-ptr.rs
1 // this program is not technically incorrect, but is an obscure enough style to be worth linting
2 #![deny(temporary_cstring_as_ptr)]
3
4 use std::ffi::CString;
5
6 fn main() {
7     let s = CString::new("some text").unwrap().as_ptr();
8     //~^ ERROR getting the inner pointer of a temporary `CString`
9 }