]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.base.stderr
Rollup merge of #97317 - GuillaumeGomez:gui-settings-text-click, r=jsha
[rust.git] / src / test / ui / type-alias-impl-trait / generic_type_does_not_live_long_enough.base.stderr
1 error: at least one trait must be specified
2   --> $DIR/generic_type_does_not_live_long_enough.rs:14:24
3    |
4 LL | type WrongGeneric<T> = impl 'static;
5    |                        ^^^^^^^^^^^^
6
7 error: non-defining opaque type use in defining scope
8   --> $DIR/generic_type_does_not_live_long_enough.rs:10:18
9    |
10 LL |     let z: i32 = x;
11    |                  ^
12    |
13 note: used non-generic type `&'static i32` for generic parameter
14   --> $DIR/generic_type_does_not_live_long_enough.rs:14:19
15    |
16 LL | type WrongGeneric<T> = impl 'static;
17    |                   ^
18
19 error[E0310]: the parameter type `T` may not live long enough
20   --> $DIR/generic_type_does_not_live_long_enough.rs:18:5
21    |
22 LL |     t
23    |     ^ ...so that the type `T` will meet its required lifetime bounds
24    |
25 help: consider adding an explicit lifetime bound...
26    |
27 LL | fn wrong_generic<T: 'static>(t: T) -> WrongGeneric<T> {
28    |                   +++++++++
29
30 error: aborting due to 3 previous errors
31
32 For more information about this error, try `rustc --explain E0310`.