|
| 1 | +error[E0658]: `impl Trait` in type aliases is unstable |
| 2 | + --> $DIR/drop_elaboration_with_errors2.rs:5:25 |
| 3 | + | |
| 4 | +LL | pub type Alias<T> = impl Sized; |
| 5 | + | ^^^^^^^^^^ |
| 6 | + | |
| 7 | + = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information |
| 8 | + = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable |
| 9 | + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 10 | + |
| 11 | +error[E0119]: conflicting implementations of trait `Trait<_>` |
| 12 | + --> $DIR/drop_elaboration_with_errors2.rs:26:1 |
| 13 | + | |
| 14 | +LL | impl<T> Trait<T> for T { |
| 15 | + | ---------------------- first implementation here |
| 16 | +... |
| 17 | +LL | impl<T> Trait<T> for defining_scope::Alias<T> { |
| 18 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation |
| 19 | + |
| 20 | +error: unconstrained opaque type |
| 21 | + --> $DIR/drop_elaboration_with_errors2.rs:5:25 |
| 22 | + | |
| 23 | +LL | pub type Alias<T> = impl Sized; |
| 24 | + | ^^^^^^^^^^ |
| 25 | + | |
| 26 | + = note: `Alias` must be used in combination with a concrete type within the same crate |
| 27 | + |
| 28 | +error[E0308]: mismatched types |
| 29 | + --> $DIR/drop_elaboration_with_errors2.rs:10:9 |
| 30 | + | |
| 31 | +LL | pub type Alias<T> = impl Sized; |
| 32 | + | ---------- the found opaque type |
| 33 | +... |
| 34 | +LL | pub fn cast<T>(x: Container<Alias<T>, T>) -> Container<T, T> { |
| 35 | + | - expected this type parameter --------------- expected `Container<T, T>` because of return type |
| 36 | +LL | x |
| 37 | + | ^ expected `Container<T, T>`, found `Container<Alias<T>, T>` |
| 38 | + | |
| 39 | + = note: expected struct `Container<T, _>` |
| 40 | + found struct `Container<Alias<T>, _>` |
| 41 | + = help: type parameters must be constrained to match other types |
| 42 | + = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters |
| 43 | + |
| 44 | +error: aborting due to 4 previous errors |
| 45 | + |
| 46 | +Some errors have detailed explanations: E0119, E0308, E0658. |
| 47 | +For more information about an error, try `rustc --explain E0119`. |
0 commit comments