]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-free-region-ordering-incorrect.stderr
Rollup merge of #105955 - Nilstrieb:no-trivial-opt-wrappers-we-have-field-accesses...
[rust.git] / src / test / ui / regions / regions-free-region-ordering-incorrect.stderr
1 error: lifetime may not live long enough
2   --> $DIR/regions-free-region-ordering-incorrect.rs:15:9
3    |
4 LL |   impl<'b, T> Node<'b, T> {
5    |        -- lifetime `'b` defined here
6 LL |       fn get<'a>(&'a self) -> &'b T {
7    |              -- lifetime `'a` defined here
8 LL | /         match self.next {
9 LL | |             Some(ref next) => next.get(),
10 LL | |             None => &self.val
11 LL | |         }
12    | |_________^ associated function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
13    |
14    = help: consider adding the following bound: `'a: 'b`
15
16 error: aborting due to previous error
17