summaryrefslogtreecommitdiffstats
path: root/tests/ui/macros/macro-lifetime-used-with-bound.rs
blob: ea3f74c9adab05a3f90044514d28080a509fb675 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// run-pass
#![allow(unused_variables)]
macro_rules! foo {
    ($l:lifetime, $l2:lifetime) => {
        fn f<$l: $l2, $l2>(arg: &$l str, arg2: &$l2 str) -> &$l str {
            arg
        }
    }
}

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