summaryrefslogtreecommitdiffstats
path: root/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.stderr
blob: 6193bf02f6d0d4f7ffaf089a2d9268f973e4b28c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
error: lifetime may not live long enough
  --> $DIR/regions-bounded-method-type-parameters-cross-crate.rs:20:5
   |
LL | fn call_bigger_region<'x, 'y>(a: Inv<'x>, b: Inv<'y>) {
   |                       --  -- lifetime `'y` defined here
   |                       |
   |                       lifetime `'x` defined here
LL |     // Here the value provided for 'y is 'y, and hence 'y:'x does not hold.
LL |     a.bigger_region(b)
   |     ^^^^^^^^^^^^^^^^^^ argument requires that `'y` must outlive `'x`
   |
   = help: consider adding the following bound: `'y: 'x`
   = note: requirement occurs because of the type `Inv<'_>`, which makes the generic argument `'_` invariant
   = note: the struct `Inv<'a>` is invariant over the parameter `'a`
   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance

error: aborting due to previous error