summaryrefslogtreecommitdiffstats
path: root/tests/ui/lint/lint-temporary-cstring-as-ptr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/lint/lint-temporary-cstring-as-ptr.rs')
-rw-r--r--tests/ui/lint/lint-temporary-cstring-as-ptr.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/lint/lint-temporary-cstring-as-ptr.rs b/tests/ui/lint/lint-temporary-cstring-as-ptr.rs
index 7aa4f2e1e..fab792f12 100644
--- a/tests/ui/lint/lint-temporary-cstring-as-ptr.rs
+++ b/tests/ui/lint/lint-temporary-cstring-as-ptr.rs
@@ -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!();
}