Fix misdetection of upstream intercrate ambiguity.

This commit is contained in:
Masaki Hara 2017-08-01 12:37:11 +04:30 committed by Niko Matsakis
parent 4d503b0c74
commit 099bb1ba8a
3 changed files with 15 additions and 10 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 of trait `Sugar` for type `std::boxed::Box<_>`
//~| NOTE downstream crates may implement 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 of trait `Sugar` for type `std::boxed::Box<_>`
//~| NOTE downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
fn main() { }