blob: 18d8daa05e63d168fb413a3ca948c39316897749 [file] [log] [blame]
error: at least one trait must be specified
--> $DIR/generic_type_does_not_live_long_enough.rs:9:24
|
LL | type WrongGeneric<T> = impl 'static;
| ^^^^^^^^^^^^
error[E0308]: mismatched types
--> $DIR/generic_type_does_not_live_long_enough.rs:6:18
|
LL | let z: i32 = x;
| --- ^ expected `i32`, found opaque type
| |
| expected due to this
...
LL | type WrongGeneric<T> = impl 'static;
| ------------ the found opaque type
|
= note: expected type `i32`
found opaque type `impl Sized`
error[E0310]: the parameter type `T` may not live long enough
--> $DIR/generic_type_does_not_live_long_enough.rs:9:24
|
LL | type WrongGeneric<T> = impl 'static;
| ^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
...
LL | fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
| - help: consider adding an explicit lifetime bound...: `T: 'static`
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0308, E0310.
For more information about an error, try `rustc --explain E0308`.