blob: f1773b7c2fc8fa953197ab417877f49fcd3177e4 [file] [log] [blame]
error[E0308]: mismatched types
--> $DIR/generic_type_does_not_live_long_enough.rs:16:18
|
LL | let z: i32 = x; //~ ERROR mismatched types
| ^ expected i32, found opaque type
|
= note: expected type `i32`
found type `WrongGeneric::<&{integer}>`
error[E0310]: the parameter type `T` may not live long enough
--> $DIR/generic_type_does_not_live_long_enough.rs:19:1
|
LL | existential type WrongGeneric<T>: 'static;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
LL | fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
| - help: consider adding an explicit lifetime bound `T: 'static`...
|
note: ...so that the type `T` will meet its required lifetime bounds
--> $DIR/generic_type_does_not_live_long_enough.rs:19:1
|
LL | existential type WrongGeneric<T>: 'static;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
Some errors occurred: E0308, E0310.
For more information about an error, try `rustc --explain E0308`.