Closed
Description
Since the compiler now supplies an implementation of the trait for itself, something like http://is.gd/Id71IX:
trait Foo { fn dummy(&self) { } }
impl Foo for Foo { }
fn main() { }```
ought to be reported as overlap. 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