about summary refs log tree commit diff
path: root/tests/ui/macros/macro-lifetime.rs
blob: 9690f40b2c3a40b33908539338acaa32a6aa6f0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//@ run-pass
macro_rules! foo {
    ($l:lifetime) => {
        fn f<$l>(arg: &$l str) -> &$l str {
            arg
        }
    }
}

pub fn main() {
    foo!('a);
    let x: &'static str = f("hi");
    assert_eq!("hi", x);
}