summaryrefslogtreecommitdiffstats
path: root/tests/ui/regions/regions-bounded-method-type-parameters-cross-crate.stderr
blob: bd8640b9d34fd506a85f3c9468e9c85eca9c48c6 (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 1 previous error