1
Fork 0
rust/tests/ui/nll/relate_tys/placeholder-outlives-existential.stderr
Amanda Stjerna e9d374c657 Add tests for two untested cases of placeholder relations
During work on #130227, I discovered several situations not covered by any
previously existing UI test. This commit introudces tests to cover that.
2025-04-22 12:07:53 +02:00

25 lines
1 KiB
Text

error[E0308]: mismatched types
--> $DIR/placeholder-outlives-existential.rs:14:5
|
LL | x
| ^ one type is more general than the other
|
= note: expected fn pointer `fn(fn(fn(for<'unify> fn(Contra<'unify>, Co<'unify>))))`
found fn pointer `for<'e> fn(for<'e, 'p> fn(for<'e, 'p> fn(for<'e, 'p> fn(Contra<'e>, Co<'p>))))`
error: lifetime may not live long enough
--> $DIR/placeholder-outlives-existential.rs:28:5
|
LL | fn e_outlives_p_static_err<'not_static>(
| ----------- lifetime `'not_static` defined here
...
LL | x
| ^ returning this value requires that `'not_static` must outlive `'static`
|
= 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 2 previous errors
For more information about this error, try `rustc --explain E0308`.