]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-free-region-ordering-callee.nll.stderr
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.git] / src / test / ui / regions / regions-free-region-ordering-callee.nll.stderr
1 error: unsatisfied lifetime constraints
2   --> $DIR/regions-free-region-ordering-callee.rs:23:5
3    |
4 LL | fn ordering2<'a, 'b>(x: &'a &'b usize, y: &'a usize) -> &'b usize {
5    |              --  -- lifetime `'b` defined here
6    |              |
7    |              lifetime `'a` defined here
8 LL |     // However, it is not safe to assume that 'b <= 'a
9 LL |     &*y //~ ERROR 23:5: 23:8: lifetime mismatch [E0623]
10    |     ^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
11
12 error: unsatisfied lifetime constraints
13   --> $DIR/regions-free-region-ordering-callee.rs:28:24
14    |
15 LL | fn ordering3<'a, 'b>(x: &'a usize, y: &'b usize) -> &'a &'b usize {
16    |              --  -- lifetime `'b` defined here
17    |              |
18    |              lifetime `'a` defined here
19 LL |     // Do not infer an ordering from the return value.
20 LL |     let z: &'b usize = &*x;
21    |                        ^^^ assignment requires that `'a` must outlive `'b`
22
23 error: aborting due to 2 previous errors
24