]> git.proxmox.com Git - rustc.git/blobdiff - tests/ui/lint/lint-temporary-cstring-as-ptr.rs
New upstream version 1.70.0+dfsg1
[rustc.git] / tests / ui / lint / lint-temporary-cstring-as-ptr.rs
index 7aa4f2e1e005cc6bcab9766045cbb8daf5a8ab16..fab792f128411f10143b4ecc4781702a1bfd307c 100644 (file)
@@ -3,7 +3,15 @@
 
 use std::ffi::CString;
 
+macro_rules! mymacro {
+    () => {
+        let s = CString::new("some text").unwrap().as_ptr();
+        //~^ ERROR getting the inner pointer of a temporary `CString`
+    }
+}
+
 fn main() {
     let s = CString::new("some text").unwrap().as_ptr();
     //~^ ERROR getting the inner pointer of a temporary `CString`
+    mymacro!();
 }