]> git.lizzy.rs Git - rust.git/blob - tests/ui/proc-macro/lifetimes-rpass.rs
Rollup merge of #106788 - estebank:elaborate_pred_E0599, r=compiler-errors
[rust.git] / tests / ui / proc-macro / lifetimes-rpass.rs
1 // run-pass
2
3 #![allow(unused_variables)]
4 // aux-build:lifetimes-rpass.rs
5
6 extern crate lifetimes_rpass as lifetimes;
7 use lifetimes::*;
8
9 lifetimes_bang! {
10     fn bang<'a>() -> &'a u8 { &0 }
11 }
12
13 #[lifetimes_attr]
14 fn attr<'a>() -> &'a u8 { &1 }
15
16 #[derive(Lifetimes)]
17 pub struct Lifetimes<'a> {
18     pub field: &'a u8,
19 }
20
21 fn main() {
22     assert_eq!(bang::<'static>(), &0);
23     assert_eq!(attr::<'static>(), &1);
24     let l1 = Lifetimes { field: &0 };
25     let l2 = m::Lifetimes { field: &1 };
26 }