fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
985 B34 linesraw
1error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
2  --> $DIR/issue-16683.rs:4:14
3   |
4LL |         self.a();
5   |              ^
6   |
7note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 3:5...
8  --> $DIR/issue-16683.rs:3:5
9   |
10LL | /     fn b(&self) {
11LL | |         self.a();
12LL | |     }
13   | |_____^
14note: ...so that reference does not outlive borrowed content
15  --> $DIR/issue-16683.rs:4:9
16   |
17LL |         self.a();
18   |         ^^^^
19note: but, the lifetime must be valid for the lifetime `'a` as defined on the trait at 1:9...
20  --> $DIR/issue-16683.rs:1:9
21   |
22LL | trait T<'a> {
23   |         ^^
24note: ...so that the types are compatible
25  --> $DIR/issue-16683.rs:4:14
26   |
27LL |         self.a();
28   |              ^
29   = note: expected  `&'a Self`
30              found  `&Self`
31
32error: aborting due to previous error
33
34For more information about this error, try `rustc --explain E0495`.