]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/lint-temporary-cstring-as-ptr.rs
Merge commit '63734fcdd718cca089f84c42f3a42c0096cfd431' into sync_cg_clif-2022-05-15
[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 }