]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/elision/lt-ref-self.rs
Make it more clear when complaining about async fn's return types
[rust.git] / src / test / ui / self / elision / lt-ref-self.rs
1 #![allow(non_snake_case)]
2
3 use std::pin::Pin;
4
5 struct Struct<'a> { data: &'a u32 }
6
7 impl<'a> Struct<'a> {
8     // Test using `&self` sugar:
9
10     fn ref_self(&self, f: &u32) -> &u32 {
11         f //~ ERROR lifetime mismatch
12     }
13
14     // Test using `&Self` explicitly:
15
16     fn ref_Self(self: &Self, f: &u32) -> &u32 {
17         f //~ ERROR lifetime mismatch
18     }
19
20     fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
21         f //~ ERROR lifetime mismatch
22     }
23
24     fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
25         f //~ ERROR lifetime mismatch
26     }
27
28     fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
29         f //~ ERROR lifetime mismatch
30     }
31
32     fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
33         f //~ ERROR lifetime mismatch
34     }
35 }
36
37 fn main() { }