Open
Description
Follow up of this comment on #90104
This test https://github.com/rust-lang/rust/pull/90104/files#diff-2c291b05493bf924a05c167ef3923655ca244b6fd8bc2303ffdc2ed2132498cc is giving an ungreat error message.
#![feature(rustc_attrs)]
#![feature(trait_alias)]
trait A {}
trait B {}
trait AB = A + B;
impl A for u32 {}
impl B for u32 {}
trait C {}
#[rustc_strict_coherence]
impl<T: AB> C for T {}
#[rustc_strict_coherence]
impl C for u32 {}
//~^ ERROR
// FIXME it's giving an ungreat error but unsure if we care given that it's using an internal rustc
// attribute and an artificial code path for testing purposes
fn main() {}
fails with ...
error[E0283]: type annotations needed
--> $DIR/coherence-overlap-trait-alias.rs:15:6
|
LL | impl C for u32 {}
| ^ cannot infer type for type `u32`
|
= note: cannot satisfy `u32: C`
note: required by a bound in `C`
--> $DIR/coherence-overlap-trait-alias.rs:11:1
|
LL | trait C {}
| ^^^^^^^ required by this bound in `C`
error: aborting due to previous error
Error should mention about conflicting implementations for u32
or something like that. More similar to what happens without using the rustc_strict_coherence
attribute.