mirror of
https://git.proxmox.com/git/rustc
synced 2025-05-02 13:57:24 +00:00
15 lines
225 B
Rust
15 lines
225 B
Rust
// 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);
|
|
}
|