]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.nll.stderr
Rollup merge of #85989 - jyn514:gitignore-cleanup, r=ehuss
[rust.git] / src / test / ui / regions / region-lifetime-bounds-on-fns-where-clause.nll.stderr
1 error: lifetime may not live long enough
2   --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:8:5
3    |
4 LL | fn b<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) {
5    |      --  -- lifetime `'b` defined here
6    |      |
7    |      lifetime `'a` defined here
8 LL |     // Illegal now because there is no `'b:'a` declaration.
9 LL |     *x = *y;
10    |     ^^^^^^^ assignment requires that `'b` must outlive `'a`
11    |
12    = help: consider adding the following bound: `'b: 'a`
13
14 error: lifetime may not live long enough
15   --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:14:5
16    |
17 LL | fn c<'a,'b>(x: &mut &'a isize, y: &mut &'b isize) {
18    |      -- -- lifetime `'b` defined here
19    |      |
20    |      lifetime `'a` defined here
21 ...
22 LL |     a(x, y);
23    |     ^^^^^^^ argument requires that `'b` must outlive `'a`
24    |
25    = help: consider adding the following bound: `'b: 'a`
26    = note: requirement occurs because of a mutable reference to &isize
27    = note: mutable references are invariant over their type parameter
28    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
29
30 error: higher-ranked subtype error
31   --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:20:12
32    |
33 LL |     let _: fn(&mut &isize, &mut &isize) = a;
34    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
35
36 error: higher-ranked subtype error
37   --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:20:12
38    |
39 LL |     let _: fn(&mut &isize, &mut &isize) = a;
40    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
41
42 error: aborting due to 4 previous errors
43