]> git.lizzy.rs Git - rust.git/blob - src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr
move an `assert!` to the right place
[rust.git] / src / test / ui / hr-subtype / hr-subtype.free_inv_x_vs_free_inv_y.stderr
1 error: lifetime may not live long enough
2   --> $DIR/hr-subtype.rs:48:13
3    |
4 LL |           fn subtype<'x, 'y: 'x, 'z: 'y>() {
5    |                      --  -- lifetime `'y` defined here
6    |                      |
7    |                      lifetime `'x` defined here
8 LL |               gimme::<$t2>(None::<$t1>);
9    |               ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y`
10 ...
11 LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
12 LL | | fn(Inv<'y>)) }
13    | |______________- in this macro invocation
14    |
15    = help: consider adding the following bound: `'x: 'y`
16    = note: requirement occurs because of the type `Inv<'_>`, which makes the generic argument `'_` invariant
17    = note: the struct `Inv<'a>` is invariant over the parameter `'a`
18    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
19    = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
20
21 error: lifetime may not live long enough
22   --> $DIR/hr-subtype.rs:54:13
23    |
24 LL |           fn supertype<'x, 'y: 'x, 'z: 'y>() {
25    |                        --  -- lifetime `'y` defined here
26    |                        |
27    |                        lifetime `'x` defined here
28 LL |               gimme::<$t1>(None::<$t2>);
29    |               ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y`
30 ...
31 LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
32 LL | | fn(Inv<'y>)) }
33    | |______________- in this macro invocation
34    |
35    = help: consider adding the following bound: `'x: 'y`
36    = note: requirement occurs because of the type `Inv<'_>`, which makes the generic argument `'_` invariant
37    = note: the struct `Inv<'a>` is invariant over the parameter `'a`
38    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
39    = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
40
41 error: aborting due to 2 previous errors
42