You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix negative traits coherence checks compile error message for type aliases #90259
#![feature(rustc_attrs)]#![feature(trait_alias)]traitA{}traitB{}traitAB = A + B;implAforu32{}implBforu32{}traitC{}#[rustc_strict_coherence]impl<T:AB>CforT{}#[rustc_strict_coherence]implCforu32{}//~^ 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 purposesfnmain(){}
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.
As an effect of @estebank's PR #89427 this error is now a bit better but it's still not there compared with the no strict version.
Anyway, not a extremely important thing given that this can only be raised by using rustc_strict_coherence which is an internal rustc attribute.
Activity
spastorino commentedon Oct 25, 2021
As an effect of @estebank's PR #89427 this error is now a bit better but it's still not there compared with the no strict version.
Anyway, not a extremely important thing given that this can only be raised by using
rustc_strict_coherencewhich is an internal rustc attribute.