]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.full_tait.stderr
Auto merge of #82347 - the8472:parallelize-tidy, r=Mark-Simulacrum
[rust.git] / src / test / ui / type-alias-impl-trait / generic_type_does_not_live_long_enough.full_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 warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
8   --> $DIR/generic_type_does_not_live_long_enough.rs:3:32
9    |
10 LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
11    |                                ^^^^^^^^^^^^^^^^^^^^^
12    |
13    = note: `#[warn(incomplete_features)]` on by default
14    = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
15
16 error[E0308]: mismatched types
17   --> $DIR/generic_type_does_not_live_long_enough.rs:9:18
18    |
19 LL |     let z: i32 = x;
20    |            ---   ^ expected `i32`, found opaque type
21    |            |
22    |            expected due to this
23 ...
24 LL | type WrongGeneric<T> = impl 'static;
25    |                        ------------ the found opaque type
26    |
27    = note:     expected type `i32`
28            found opaque type `impl Sized`
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    |                        ^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
35 ...
36 LL | fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
37    |                  - help: consider adding an explicit lifetime bound...: `T: 'static`
38
39 error[E0310]: the parameter type `T` may not live long enough
40   --> $DIR/generic_type_does_not_live_long_enough.rs:12:24
41    |
42 LL | type WrongGeneric<T> = impl 'static;
43    |                        ^^^^^^^^^^^^
44    |
45    = help: consider adding an explicit lifetime bound `T: 'static`...
46    = note: ...so that the type `T` will meet its required lifetime bounds
47
48 error: aborting due to 4 previous errors; 1 warning emitted
49
50 Some errors have detailed explanations: E0308, E0310.
51 For more information about an error, try `rustc --explain E0308`.