diff options
Diffstat (limited to 'tests/ui/macros/macro-lifetime-used-with-static.rs')
-rw-r--r-- | tests/ui/macros/macro-lifetime-used-with-static.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/macros/macro-lifetime-used-with-static.rs b/tests/ui/macros/macro-lifetime-used-with-static.rs new file mode 100644 index 000000000..8552c4b81 --- /dev/null +++ b/tests/ui/macros/macro-lifetime-used-with-static.rs @@ -0,0 +1,14 @@ +// run-pass +macro_rules! foo { + ($l:lifetime) => { + fn f(arg: &$l str) -> &$l str { + arg + } + } +} + +pub fn main() { + foo!('static); + let x: &'static str = f("hi"); + assert_eq!("hi", x); +} |