2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(unused_variables)]
|
2017-05-10 00:30:47 +00:00
|
|
|
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);
|
|
|
|
|
}
|