]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.min_tait.stderr
Rollup merge of #80705 - tspiteri:italic-and-update-SourceCodePro, r=GuillaumeGomez
[rust.git] / src / test / ui / type-alias-impl-trait / generic_type_does_not_live_long_enough.min_tait.stderr
1 error: at least one trait must be specified
2   --> $DIR/generic_type_does_not_live_long_enough.rs:12:24
3    |
4 LL | type WrongGeneric<T> = impl 'static;
5    |                        ^^^^^^^^^^^^
6
7 error[E0308]: mismatched types
8   --> $DIR/generic_type_does_not_live_long_enough.rs:9:18
9    |
10 LL |     let z: i32 = x;
11    |            ---   ^ expected `i32`, found opaque type
12    |            |
13    |            expected due to this
14 ...
15 LL | type WrongGeneric<T> = impl 'static;
16    |                        ------------ the found opaque type
17    |
18    = note:     expected type `i32`
19            found opaque type `impl Sized`
20
21 error[E0310]: the parameter type `T` may not live long enough
22   --> $DIR/generic_type_does_not_live_long_enough.rs:12:24
23    |
24 LL | type WrongGeneric<T> = impl 'static;
25    |                        ^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
26 ...
27 LL | fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
28    |                  - help: consider adding an explicit lifetime bound...: `T: 'static`
29
30 error[E0310]: the parameter type `T` may not live long enough
31   --> $DIR/generic_type_does_not_live_long_enough.rs:12:24
32    |
33 LL | type WrongGeneric<T> = impl 'static;
34    |                        ^^^^^^^^^^^^
35    |
36    = help: consider adding an explicit lifetime bound `T: 'static`...
37    = note: ...so that the type `T` will meet its required lifetime bounds
38
39 error: aborting due to 4 previous errors
40
41 Some errors have detailed explanations: E0308, E0310.
42 For more information about an error, try `rustc --explain E0308`.