Adjust overlap-related tests to account for cosmetic changes to error reporting behavior
This commit is contained in:
parent
a3825827b7
commit
d8160799b5
15 changed files with 43 additions and 45 deletions
|
@ -22,6 +22,12 @@ pub trait IntoCow<'a, B: ?Sized> {
|
|||
fn into_cow(self) -> Cow<'a, B>;
|
||||
}
|
||||
|
||||
impl<'a, B: ?Sized> IntoCow<'a, B> for <B as ToOwned>::Owned where B: ToOwned {
|
||||
fn into_cow(self) -> Cow<'a, B> {
|
||||
Cow(PhantomData)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, B: ?Sized> IntoCow<'a, B> for Cow<'a, B> where B: ToOwned {
|
||||
//~^ ERROR E0119
|
||||
fn into_cow(self) -> Cow<'a, B> {
|
||||
|
@ -29,14 +35,8 @@ impl<'a, B: ?Sized> IntoCow<'a, B> for Cow<'a, B> where B: ToOwned {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a, B: ?Sized> IntoCow<'a, B> for <B as ToOwned>::Owned where B: ToOwned {
|
||||
//~^ ERROR E0119
|
||||
fn into_cow(self) -> Cow<'a, B> {
|
||||
Cow(PhantomData)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, B: ?Sized> IntoCow<'a, B> for &'a B where B: ToOwned {
|
||||
//~^ ERROR E0119
|
||||
fn into_cow(self) -> Cow<'a, B> {
|
||||
Cow(PhantomData)
|
||||
}
|
||||
|
|
|
@ -27,11 +27,11 @@ impl Even for isize { }
|
|||
|
||||
impl Odd for usize { }
|
||||
|
||||
impl<T:Even> MyTrait for T { //~ ERROR E0119
|
||||
impl<T:Even> MyTrait for T {
|
||||
fn get(&self) -> usize { 0 }
|
||||
}
|
||||
|
||||
impl<T:Odd> MyTrait for T {
|
||||
impl<T:Odd> MyTrait for T { //~ ERROR E0119
|
||||
fn get(&self) -> usize { 0 }
|
||||
}
|
||||
|
||||
|
|
|
@ -23,11 +23,11 @@ trait Even {}
|
|||
|
||||
trait Odd {}
|
||||
|
||||
impl<T:Even> MyTrait for T { //~ ERROR E0119
|
||||
impl<T:Even> MyTrait for T {
|
||||
fn get(&self) -> usize { 0 }
|
||||
}
|
||||
|
||||
impl<T:Odd> MyTrait for T {
|
||||
impl<T:Odd> MyTrait for T { //~ ERROR E0119
|
||||
fn get(&self) -> usize { 0 }
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ trait MyTrait<T> {
|
|||
fn get(&self) -> T;
|
||||
}
|
||||
|
||||
impl<T> MyTrait<T> for T { //~ ERROR E0119
|
||||
impl<T> MyTrait<T> for T {
|
||||
fn get(&self) -> T {
|
||||
panic!()
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ struct MyType {
|
|||
dummy: usize
|
||||
}
|
||||
|
||||
impl MyTrait<MyType> for MyType {
|
||||
impl MyTrait<MyType> for MyType { //~ ERROR E0119
|
||||
fn get(&self) -> usize { (*self).clone() }
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ trait MyTrait {
|
|||
fn get(&self) -> usize;
|
||||
}
|
||||
|
||||
impl<T:OtherTrait> MyTrait for T { //~ ERROR E0119
|
||||
impl<T:OtherTrait> MyTrait for T {
|
||||
fn get(&self) -> usize { 0 }
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ struct MyType {
|
|||
dummy: usize
|
||||
}
|
||||
|
||||
impl MyTrait for MyType {
|
||||
impl MyTrait for MyType { //~ ERROR E0119
|
||||
fn get(&self) -> usize { self.dummy }
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ trait MyTrait {
|
|||
fn get(&self) -> usize;
|
||||
}
|
||||
|
||||
impl<T> MyTrait for T { //~ ERROR E0119
|
||||
impl<T> MyTrait for T {
|
||||
fn get(&self) -> usize { 0 }
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ struct MyType {
|
|||
dummy: usize
|
||||
}
|
||||
|
||||
impl MyTrait for MyType {
|
||||
impl MyTrait for MyType { //~ ERROR E0119
|
||||
fn get(&self) -> usize { self.dummy }
|
||||
}
|
||||
|
||||
|
|
|
@ -15,8 +15,6 @@ trait MyTrait {}
|
|||
struct TestType<T>(::std::marker::PhantomData<T>);
|
||||
|
||||
unsafe impl<T: MyTrait+'static> Send for TestType<T> {}
|
||||
//~^ ERROR conflicting implementations of trait `core::marker::Send`
|
||||
//~^^ ERROR conflicting implementations of trait `core::marker::Send`
|
||||
|
||||
impl<T: MyTrait> !Send for TestType<T> {}
|
||||
//~^ ERROR conflicting implementations of trait `core::marker::Send`
|
||||
|
|
|
@ -19,10 +19,10 @@
|
|||
trait From<U> {
|
||||
}
|
||||
|
||||
impl <T> From<T> for T { //~ ERROR E0119
|
||||
impl <T> From<T> for T {
|
||||
}
|
||||
|
||||
impl <T11, U11> From<(U11,)> for (T11,) {
|
||||
impl <T11, U11> From<(U11,)> for (T11,) { //~ ERROR E0119
|
||||
}
|
||||
|
||||
fn main() { }
|
||||
|
|
|
@ -14,6 +14,6 @@
|
|||
|
||||
pub trait Sugar { fn dummy(&self) { } }
|
||||
pub trait Sweet { fn dummy(&self) { } }
|
||||
impl<T:Sugar> Sweet for T { } //~ ERROR E0119
|
||||
impl<U:Sugar> Sweet for Box<U> { }
|
||||
impl<T:Sugar> Sweet for T { }
|
||||
impl<U:Sugar> Sweet for Box<U> { } //~ ERROR E0119
|
||||
fn main() { }
|
||||
|
|
|
@ -10,23 +10,23 @@
|
|||
|
||||
trait Foo {}
|
||||
|
||||
impl<T> Foo for T {} //~ ERROR conflicting implementations of trait `Foo`:
|
||||
impl<U> Foo for U {}
|
||||
impl<T> Foo for T {}
|
||||
impl<U> Foo for U {} //~ ERROR conflicting implementations of trait `Foo`:
|
||||
|
||||
trait Bar {}
|
||||
|
||||
impl<T> Bar for (T, u8) {} //~ ERROR conflicting implementations of trait `Bar` for type `(u8, u8)`:
|
||||
impl<T> Bar for (u8, T) {}
|
||||
impl<T> Bar for (T, u8) {}
|
||||
impl<T> Bar for (u8, T) {} //~ ERROR conflicting implementations of trait `Bar` for type `(u8, u8)`:
|
||||
|
||||
trait Baz<T> {}
|
||||
|
||||
impl<T> Baz<u8> for T {} //~ ERROR conflicting implementations of trait `Baz<u8>` for type `u8`:
|
||||
impl<T> Baz<T> for u8 {}
|
||||
impl<T> Baz<u8> for T {}
|
||||
impl<T> Baz<T> for u8 {} //~ ERROR conflicting implementations of trait `Baz<u8>` for type `u8`:
|
||||
|
||||
trait Quux<U, V> {}
|
||||
|
||||
impl<T, U, V> Quux<U, V> for T {} //~ ERROR conflicting implementations of trait `Quux<_, _>`:
|
||||
impl<T, U> Quux<U, U> for T {}
|
||||
impl<T, V> Quux<T, V> for T {}
|
||||
impl<T, U, V> Quux<U, V> for T {}
|
||||
impl<T, U> Quux<U, U> for T {} //~ ERROR conflicting implementations of trait `Quux<_, _>`:
|
||||
impl<T, V> Quux<T, V> for T {} //~ ERROR conflicting implementations of trait `Quux<_, _>`:
|
||||
|
||||
fn main() {}
|
||||
|
|
|
@ -18,11 +18,11 @@ trait MyTrait {
|
|||
fn get(&self) -> usize;
|
||||
}
|
||||
|
||||
impl<T> MyTrait for (T,T) { //~ ERROR E0119
|
||||
impl<T> MyTrait for (T,T) {
|
||||
fn get(&self) -> usize { 0 }
|
||||
}
|
||||
|
||||
impl<A,B> MyTrait for (A,B) {
|
||||
impl<A,B> MyTrait for (A,B) { //~ ERROR E0119
|
||||
fn get(&self) -> usize { self.dummy }
|
||||
}
|
||||
|
||||
|
|
|
@ -21,10 +21,10 @@ struct MyType { x: i32 }
|
|||
|
||||
trait MyTrait { }
|
||||
|
||||
impl<T: lib::MyCopy> MyTrait for T { } //~ ERROR E0119
|
||||
impl<T: lib::MyCopy> MyTrait for T { }
|
||||
|
||||
// Tuples are not fundamental.
|
||||
impl MyTrait for lib::MyFundamentalStruct<(MyType,)> { }
|
||||
impl MyTrait for lib::MyFundamentalStruct<(MyType,)> { } //~ ERROR E0119
|
||||
|
||||
#[rustc_error]
|
||||
fn main() { }
|
||||
|
|
|
@ -18,7 +18,7 @@ extern crate coherence_copy_like_lib as lib;
|
|||
struct MyType { x: i32 }
|
||||
|
||||
trait MyTrait { }
|
||||
impl<T: lib::MyCopy> MyTrait for T { } //~ ERROR E0119
|
||||
impl<T: lib::MyCopy> MyTrait for T { }
|
||||
|
||||
// `MyStruct` is not declared fundamental, therefore this would
|
||||
// require that
|
||||
|
@ -26,6 +26,6 @@ impl<T: lib::MyCopy> MyTrait for T { } //~ ERROR E0119
|
|||
// MyStruct<MyType>: !MyTrait
|
||||
//
|
||||
// which we cannot approve.
|
||||
impl MyTrait for lib::MyStruct<MyType> { }
|
||||
impl MyTrait for lib::MyStruct<MyType> { } //~ ERROR E0119
|
||||
|
||||
fn main() { }
|
||||
|
|
|
@ -18,13 +18,13 @@ extern crate coherence_copy_like_lib as lib;
|
|||
struct MyType { x: i32 }
|
||||
|
||||
trait MyTrait { }
|
||||
impl<T: lib::MyCopy> MyTrait for T { } //~ ERROR E0119
|
||||
impl<T: lib::MyCopy> MyTrait for T { }
|
||||
|
||||
// Tuples are not fundamental, therefore this would require that
|
||||
//
|
||||
// (MyType,): !MyTrait
|
||||
//
|
||||
// which we cannot approve.
|
||||
impl MyTrait for (MyType,) { }
|
||||
impl MyTrait for (MyType,) { } //~ ERROR E0119
|
||||
|
||||
fn main() { }
|
||||
|
|
|
@ -10,14 +10,14 @@
|
|||
|
||||
struct MyStruct;
|
||||
|
||||
impl Drop for MyStruct {
|
||||
//~^ ERROR conflicting implementations of trait
|
||||
fn drop(&mut self) { }
|
||||
}
|
||||
|
||||
impl Drop for MyStruct {
|
||||
//~^ NOTE conflicting implementation is here
|
||||
fn drop(&mut self) { }
|
||||
}
|
||||
|
||||
impl Drop for MyStruct {
|
||||
//~^ ERROR conflicting implementations of trait
|
||||
fn drop(&mut self) { }
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
Loading…
Add table
Reference in a new issue