Print more detailed trait-ref for intercrate ambiguity.

This commit is contained in:
Masaki Hara 2017-08-01 10:27:25 +04:30 committed by Niko Matsakis
parent 84bfc33fac
commit d153ff3f79
8 changed files with 49 additions and 22 deletions

View file

@ -19,7 +19,7 @@ struct Cake<X>(X);
impl<T:Sugar> Cake<T> { fn dummy(&self) { } }
//~^ ERROR E0592
//~| NOTE duplicate definitions for `dummy`
//~| NOTE upstream crates may add new impl for `Sugar` in future versions
//~| NOTE upstream crates may add new impl of trait `Sugar` for type `std::boxed::Box<_>`
impl<U:Sugar> Cake<Box<U>> { fn dummy(&self) { } }
//~^ NOTE other definition for `dummy`

View file

@ -19,6 +19,6 @@ impl<T:Sugar> Sweet for T { }
impl<U:Sugar> Sweet for Box<U> { }
//~^ ERROR E0119
//~| NOTE conflicting implementation for `std::boxed::Box<_>`
//~| NOTE upstream crates may add new impl for `Sugar` in future versions
//~| NOTE upstream crates may add new impl of trait `Sugar` for type `std::boxed::Box<_>`
fn main() { }

View file

@ -21,7 +21,7 @@ struct A<X>(X);
impl<T> A<T> where T: Remote { fn dummy(&self) { } }
//~^ ERROR E0592
//~| NOTE duplicate definitions for `dummy`
//~| NOTE upstream crates may add new impl for `coherence_lib::Remote` in future versions
//~| NOTE upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16`
impl A<i16> { fn dummy(&self) { } }
//~^ NOTE other definition for `dummy`

View file

@ -23,6 +23,6 @@ impl<T> Foo for T where T: Remote {}
impl Foo for i16 {}
//~^ ERROR E0119
//~| NOTE conflicting implementation for `i16`
//~| NOTE upstream crates may add new impl for `coherence_lib::Remote` in future versions
//~| NOTE upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16`
fn main() {}

View file

@ -25,7 +25,7 @@ error[E0592]: duplicate definitions with name `baz`
43 | fn baz(&self) {}
| ---------------- other definition for `baz`
|
= note: upstream crates may add new impl for `std::marker::Copy` in future versions
= note: upstream crates may add new impl of trait `std::marker::Copy` for type `std::vec::Vec<_>` in future versions
error: aborting due to 3 previous errors