2024-07-04 10:53:37 -05:00
|
|
|
error: lifetime may not live long enough
|
2024-09-10 11:47:10 -05:00
|
|
|
--> $DIR/ptr-to-trait-obj-different-regions-id-trait.rs:24:27
|
2024-07-04 10:53:37 -05:00
|
|
|
|
|
|
|
|
LL | fn m<'a>() {
|
|
|
|
| -- lifetime `'a` defined here
|
|
|
|
LL | let unsend: *const dyn Cat<'a> = &();
|
|
|
|
LL | let _send = unsend as *const S<dyn Cat<'static>>;
|
2024-09-10 11:47:10 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
|
2024-07-04 10:53:37 -05:00
|
|
|
|
|
|
|
|
= note: requirement occurs because of the type `S<dyn Cat<'_>>`, which makes the generic argument `dyn Cat<'_>` invariant
|
|
|
|
= note: the struct `S<T>` is invariant over the parameter `T`
|
|
|
|
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
|
|
|
|
|
|
|
|
error: aborting due to 1 previous error
|
|
|
|
|