]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.full_tait.stderr
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / test / ui / type-alias-impl-trait / generic_type_does_not_live_long_enough.full_tait.stderr
diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.full_tait.stderr
new file mode 100644 (file)
index 0000000..6394a1f
--- /dev/null
@@ -0,0 +1,51 @@
+error: at least one trait must be specified
+  --> $DIR/generic_type_does_not_live_long_enough.rs:12:24
+   |
+LL | type WrongGeneric<T> = impl 'static;
+   |                        ^^^^^^^^^^^^
+
+warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+  --> $DIR/generic_type_does_not_live_long_enough.rs:3:32
+   |
+LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
+   |                                ^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: `#[warn(incomplete_features)]` on by default
+   = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
+
+error[E0308]: mismatched types
+  --> $DIR/generic_type_does_not_live_long_enough.rs:9: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:12: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[E0310]: the parameter type `T` may not live long enough
+  --> $DIR/generic_type_does_not_live_long_enough.rs:12:24
+   |
+LL | type WrongGeneric<T> = impl 'static;
+   |                        ^^^^^^^^^^^^
+   |
+   = help: consider adding an explicit lifetime bound `T: 'static`...
+   = note: ...so that the type `T` will meet its required lifetime bounds
+
+error: aborting due to 4 previous errors; 1 warning emitted
+
+Some errors have detailed explanations: E0308, E0310.
+For more information about an error, try `rustc --explain E0308`.