]> git.lizzy.rs Git - rust.git/blob - tests/ui/lint/lint-temporary-cstring-as-ptr.rs
Rollup merge of #104965 - zacklukem:p-option-as_ref-docs, r=scottmcm
[rust.git] / tests / 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 }