summaryrefslogtreecommitdiffstats
path: root/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr')
-rw-r--r--src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr b/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr
new file mode 100644
index 000000000..31d36d716
--- /dev/null
+++ b/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr
@@ -0,0 +1,42 @@
+error: lifetime may not live long enough
+ --> $DIR/hr-subtype.rs:48:13
+ |
+LL | fn subtype<'x, 'y: 'x, 'z: 'y>() {
+ | -- -- lifetime `'y` defined here
+ | |
+ | lifetime `'x` defined here
+LL | gimme::<$t2>(None::<$t1>);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y`
+...
+LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
+LL | | fn(Inv<'y>)) }
+ | |______________- in this macro invocation
+ |
+ = help: consider adding the following bound: `'x: 'y`
+ = 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
+ = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: lifetime may not live long enough
+ --> $DIR/hr-subtype.rs:54:13
+ |
+LL | fn supertype<'x, 'y: 'x, 'z: 'y>() {
+ | -- -- lifetime `'y` defined here
+ | |
+ | lifetime `'x` defined here
+LL | gimme::<$t1>(None::<$t2>);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y`
+...
+LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
+LL | | fn(Inv<'y>)) }
+ | |______________- in this macro invocation
+ |
+ = help: consider adding the following bound: `'x: 'y`
+ = 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
+ = note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 2 previous errors
+