]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-free-region-ordering-incorrect.stderr
3dce04e2452add6fd24f8580f98f5cb4b855d77c
[rust.git] / src / test / ui / regions / regions-free-region-ordering-incorrect.stderr
1 error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements
2   --> $DIR/regions-free-region-ordering-incorrect.rs:27:15
3    |
4 LL |       None => &self.val //~ ERROR cannot infer
5    |               ^^^^^^^^^
6    |
7 note: first, the lifetime cannot outlive the lifetime 'a as defined on the method body at 24:10...
8   --> $DIR/regions-free-region-ordering-incorrect.rs:24:10
9    |
10 LL |   fn get<'a>(&'a self) -> &'b T {
11    |          ^^
12 note: ...so that reference does not outlive borrowed content
13   --> $DIR/regions-free-region-ordering-incorrect.rs:27:15
14    |
15 LL |       None => &self.val //~ ERROR cannot infer
16    |               ^^^^^^^^^
17 note: but, the lifetime must be valid for the lifetime 'b as defined on the impl at 23:6...
18   --> $DIR/regions-free-region-ordering-incorrect.rs:23:6
19    |
20 LL | impl<'b, T> Node<'b, T> {
21    |      ^^
22 note: ...so that reference does not outlive borrowed content
23   --> $DIR/regions-free-region-ordering-incorrect.rs:25:5
24    |
25 LL | /     match self.next {
26 LL | |       Some(ref next) => next.get(),
27 LL | |       None => &self.val //~ ERROR cannot infer
28 LL | |     }
29    | |_____^
30
31 error: aborting due to previous error
32
33 For more information about this error, try `rustc --explain E0495`.