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
Since the compiler now supplies an implementation of the trait for itself, something like http://is.gd/Id71IX:
traitFoo{fndummy(&self){}}implFooforFoo{}fnmain(){}```
ought to be reported asoverlap.Instead we get an error later when we find an ambiguity:
:2:1: 2:21 error: internal compiler error: coherence failed to report ambiguity: cannot locate the impl of the trait Foo for the type Foo
:2 impl Foo for Foo { }
^~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with RUST_BACKTRACE=1 for a backtrace
thread 'rustc' panicked at 'Box', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:130
The text was updated successfully, but these errors were encountered:
nikomatsakis
added
the
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
label
Apr 3, 2015
If we find a blanket impl for `Trait` but we're matching on an object `Trait`, prefer the object (I think we could perhaps go either way, but this seems safer). Also give a nice error for attempts to manually `impl Trait for Trait`, since they will be ineffectual.
This fixes the problems around ambiguity ICEs relating to `Any` and `MarkerTrait` that were cropping up all over the place. There may still be similar ICEs reported in #21756 that this PR does not address.
Fixes#24015.
Fixes#24051.
Fixes#24037.
Fixes#23853.
Fixes#21942.
cc #21756.
cc @alexcrichton (this fixes crates.io)
r? @aturon
Since the compiler now supplies an implementation of the trait for itself, something like http://is.gd/Id71IX:
:2:1: 2:21 error: internal compiler error: coherence failed to report ambiguity: cannot locate the impl of the trait
Foo
for the typeFoo
:2 impl Foo for Foo { }
^~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with
RUST_BACKTRACE=1
for a backtracethread 'rustc' panicked at 'Box', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:130
The text was updated successfully, but these errors were encountered: