]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-free-region-ordering-incorrect.stderr
Merge branch 'master' into rusty-hermit
[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:17:21
3    |
4 LL |             None => &self.val
5    |                     ^^^^^^^^^
6    |
7 note: first, the lifetime cannot outlive the lifetime `'a` as defined on the method body at 14:12...
8   --> $DIR/regions-free-region-ordering-incorrect.rs:14:12
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:17:21
14    |
15 LL |             None => &self.val
16    |                     ^^^^^^^^^
17 note: but, the lifetime must be valid for the lifetime `'b` as defined on the impl at 13:6...
18   --> $DIR/regions-free-region-ordering-incorrect.rs:13: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:15:9
24    |
25 LL | /         match self.next {
26 LL | |             Some(ref next) => next.get(),
27 LL | |             None => &self.val
28 LL | |         }
29    | |_________^
30
31 error: aborting due to previous error
32
33 For more information about this error, try `rustc --explain E0495`.