]> git.lizzy.rs Git - rust.git/blob - tests/ui/regions/regions-bounded-method-type-parameters-trait-bound.stderr
internally change regions to be covariant
[rust.git] / tests / ui / regions / regions-bounded-method-type-parameters-trait-bound.stderr
1 error: lifetime may not live long enough
2   --> $DIR/regions-bounded-method-type-parameters-trait-bound.rs:20:5
3    |
4 LL | fn caller2<'a,'b,F:Foo<'a>>(a: Inv<'a>, b: Inv<'b>, f: F) {
5    |            -- -- lifetime `'b` defined here
6    |            |
7    |            lifetime `'a` defined here
8 LL |     // Here the value provided for 'y is 'b, and hence 'b:'a does not hold.
9 LL |     f.method(b);
10    |     ^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
11    |
12    = help: consider adding the following bound: `'b: 'a`
13    = note: requirement occurs because of the type `Inv<'_>`, which makes the generic argument `'_` invariant
14    = note: the struct `Inv<'a>` is invariant over the parameter `'a`
15    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
16
17 error: aborting due to previous error
18