diff options
Diffstat (limited to 'src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.stderr')
-rw-r--r-- | src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.stderr | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.stderr new file mode 100644 index 000000000..6193bf02f --- /dev/null +++ b/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.stderr @@ -0,0 +1,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 + |