Skip to content

Commit d816079

Browse files
committed
Adjust overlap-related tests to account for cosmetic changes to error reporting behavior
1 parent a382582 commit d816079

15 files changed

+38
-40
lines changed

src/test/compile-fail/associated-types-coherence-failure.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ pub trait IntoCow<'a, B: ?Sized> {
2222
fn into_cow(self) -> Cow<'a, B>;
2323
}
2424

25-
impl<'a, B: ?Sized> IntoCow<'a, B> for Cow<'a, B> where B: ToOwned {
26-
//~^ ERROR E0119
25+
impl<'a, B: ?Sized> IntoCow<'a, B> for <B as ToOwned>::Owned where B: ToOwned {
2726
fn into_cow(self) -> Cow<'a, B> {
28-
self
27+
Cow(PhantomData)
2928
}
3029
}
3130

32-
impl<'a, B: ?Sized> IntoCow<'a, B> for <B as ToOwned>::Owned where B: ToOwned {
31+
impl<'a, B: ?Sized> IntoCow<'a, B> for Cow<'a, B> where B: ToOwned {
3332
//~^ ERROR E0119
3433
fn into_cow(self) -> Cow<'a, B> {
35-
Cow(PhantomData)
34+
self
3635
}
3736
}
3837

3938
impl<'a, B: ?Sized> IntoCow<'a, B> for &'a B where B: ToOwned {
39+
//~^ ERROR E0119
4040
fn into_cow(self) -> Cow<'a, B> {
4141
Cow(PhantomData)
4242
}

src/test/compile-fail/coherence-blanket-conflicts-with-blanket-implemented.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ impl Even for isize { }
2727

2828
impl Odd for usize { }
2929

30-
impl<T:Even> MyTrait for T { //~ ERROR E0119
30+
impl<T:Even> MyTrait for T {
3131
fn get(&self) -> usize { 0 }
3232
}
3333

34-
impl<T:Odd> MyTrait for T {
34+
impl<T:Odd> MyTrait for T { //~ ERROR E0119
3535
fn get(&self) -> usize { 0 }
3636
}
3737

src/test/compile-fail/coherence-blanket-conflicts-with-blanket-unimplemented.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ trait Even {}
2323

2424
trait Odd {}
2525

26-
impl<T:Even> MyTrait for T { //~ ERROR E0119
26+
impl<T:Even> MyTrait for T {
2727
fn get(&self) -> usize { 0 }
2828
}
2929

30-
impl<T:Odd> MyTrait for T {
30+
impl<T:Odd> MyTrait for T { //~ ERROR E0119
3131
fn get(&self) -> usize { 0 }
3232
}
3333

src/test/compile-fail/coherence-blanket-conflicts-with-specific-multidispatch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ trait MyTrait<T> {
1818
fn get(&self) -> T;
1919
}
2020

21-
impl<T> MyTrait<T> for T { //~ ERROR E0119
21+
impl<T> MyTrait<T> for T {
2222
fn get(&self) -> T {
2323
panic!()
2424
}
@@ -29,7 +29,7 @@ struct MyType {
2929
dummy: usize
3030
}
3131

32-
impl MyTrait<MyType> for MyType {
32+
impl MyTrait<MyType> for MyType { //~ ERROR E0119
3333
fn get(&self) -> usize { (*self).clone() }
3434
}
3535

src/test/compile-fail/coherence-blanket-conflicts-with-specific-trait.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ trait MyTrait {
1919
fn get(&self) -> usize;
2020
}
2121

22-
impl<T:OtherTrait> MyTrait for T { //~ ERROR E0119
22+
impl<T:OtherTrait> MyTrait for T {
2323
fn get(&self) -> usize { 0 }
2424
}
2525

2626
struct MyType {
2727
dummy: usize
2828
}
2929

30-
impl MyTrait for MyType {
30+
impl MyTrait for MyType { //~ ERROR E0119
3131
fn get(&self) -> usize { self.dummy }
3232
}
3333

src/test/compile-fail/coherence-blanket-conflicts-with-specific.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ trait MyTrait {
1818
fn get(&self) -> usize;
1919
}
2020

21-
impl<T> MyTrait for T { //~ ERROR E0119
21+
impl<T> MyTrait for T {
2222
fn get(&self) -> usize { 0 }
2323
}
2424

2525
struct MyType {
2626
dummy: usize
2727
}
2828

29-
impl MyTrait for MyType {
29+
impl MyTrait for MyType { //~ ERROR E0119
3030
fn get(&self) -> usize { self.dummy }
3131
}
3232

src/test/compile-fail/coherence-conflicting-negative-trait-impl.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ trait MyTrait {}
1515
struct TestType<T>(::std::marker::PhantomData<T>);
1616

1717
unsafe impl<T: MyTrait+'static> Send for TestType<T> {}
18-
//~^ ERROR conflicting implementations of trait `core::marker::Send`
19-
//~^^ ERROR conflicting implementations of trait `core::marker::Send`
2018

2119
impl<T: MyTrait> !Send for TestType<T> {}
2220
//~^ ERROR conflicting implementations of trait `core::marker::Send`

src/test/compile-fail/coherence-overlap-all-t-and-tuple.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
trait From<U> {
2020
}
2121

22-
impl <T> From<T> for T { //~ ERROR E0119
22+
impl <T> From<T> for T {
2323
}
2424

25-
impl <T11, U11> From<(U11,)> for (T11,) {
25+
impl <T11, U11> From<(U11,)> for (T11,) { //~ ERROR E0119
2626
}
2727

2828
fn main() { }

src/test/compile-fail/coherence-overlap-issue-23516.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414

1515
pub trait Sugar { fn dummy(&self) { } }
1616
pub trait Sweet { fn dummy(&self) { } }
17-
impl<T:Sugar> Sweet for T { } //~ ERROR E0119
18-
impl<U:Sugar> Sweet for Box<U> { }
17+
impl<T:Sugar> Sweet for T { }
18+
impl<U:Sugar> Sweet for Box<U> { } //~ ERROR E0119
1919
fn main() { }

src/test/compile-fail/coherence-overlap-messages.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@
1010

1111
trait Foo {}
1212

13-
impl<T> Foo for T {} //~ ERROR conflicting implementations of trait `Foo`:
14-
impl<U> Foo for U {}
13+
impl<T> Foo for T {}
14+
impl<U> Foo for U {} //~ ERROR conflicting implementations of trait `Foo`:
1515

1616
trait Bar {}
1717

18-
impl<T> Bar for (T, u8) {} //~ ERROR conflicting implementations of trait `Bar` for type `(u8, u8)`:
19-
impl<T> Bar for (u8, T) {}
18+
impl<T> Bar for (T, u8) {}
19+
impl<T> Bar for (u8, T) {} //~ ERROR conflicting implementations of trait `Bar` for type `(u8, u8)`:
2020

2121
trait Baz<T> {}
2222

23-
impl<T> Baz<u8> for T {} //~ ERROR conflicting implementations of trait `Baz<u8>` for type `u8`:
24-
impl<T> Baz<T> for u8 {}
23+
impl<T> Baz<u8> for T {}
24+
impl<T> Baz<T> for u8 {} //~ ERROR conflicting implementations of trait `Baz<u8>` for type `u8`:
2525

2626
trait Quux<U, V> {}
2727

28-
impl<T, U, V> Quux<U, V> for T {} //~ ERROR conflicting implementations of trait `Quux<_, _>`:
29-
impl<T, U> Quux<U, U> for T {}
30-
impl<T, V> Quux<T, V> for T {}
28+
impl<T, U, V> Quux<U, V> for T {}
29+
impl<T, U> Quux<U, U> for T {} //~ ERROR conflicting implementations of trait `Quux<_, _>`:
30+
impl<T, V> Quux<T, V> for T {} //~ ERROR conflicting implementations of trait `Quux<_, _>`:
3131

3232
fn main() {}

src/test/compile-fail/coherence-tuple-conflict.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ trait MyTrait {
1818
fn get(&self) -> usize;
1919
}
2020

21-
impl<T> MyTrait for (T,T) { //~ ERROR E0119
21+
impl<T> MyTrait for (T,T) {
2222
fn get(&self) -> usize { 0 }
2323
}
2424

25-
impl<A,B> MyTrait for (A,B) {
25+
impl<A,B> MyTrait for (A,B) { //~ ERROR E0119
2626
fn get(&self) -> usize { self.dummy }
2727
}
2828

src/test/compile-fail/coherence_copy_like_err_fundamental_struct_tuple.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ struct MyType { x: i32 }
2121

2222
trait MyTrait { }
2323

24-
impl<T: lib::MyCopy> MyTrait for T { } //~ ERROR E0119
24+
impl<T: lib::MyCopy> MyTrait for T { }
2525

2626
// Tuples are not fundamental.
27-
impl MyTrait for lib::MyFundamentalStruct<(MyType,)> { }
27+
impl MyTrait for lib::MyFundamentalStruct<(MyType,)> { } //~ ERROR E0119
2828

2929
#[rustc_error]
3030
fn main() { }

src/test/compile-fail/coherence_copy_like_err_struct.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ extern crate coherence_copy_like_lib as lib;
1818
struct MyType { x: i32 }
1919

2020
trait MyTrait { }
21-
impl<T: lib::MyCopy> MyTrait for T { } //~ ERROR E0119
21+
impl<T: lib::MyCopy> MyTrait for T { }
2222

2323
// `MyStruct` is not declared fundamental, therefore this would
2424
// require that
2525
//
2626
// MyStruct<MyType>: !MyTrait
2727
//
2828
// which we cannot approve.
29-
impl MyTrait for lib::MyStruct<MyType> { }
29+
impl MyTrait for lib::MyStruct<MyType> { } //~ ERROR E0119
3030

3131
fn main() { }

src/test/compile-fail/coherence_copy_like_err_tuple.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ extern crate coherence_copy_like_lib as lib;
1818
struct MyType { x: i32 }
1919

2020
trait MyTrait { }
21-
impl<T: lib::MyCopy> MyTrait for T { } //~ ERROR E0119
21+
impl<T: lib::MyCopy> MyTrait for T { }
2222

2323
// Tuples are not fundamental, therefore this would require that
2424
//
2525
// (MyType,): !MyTrait
2626
//
2727
// which we cannot approve.
28-
impl MyTrait for (MyType,) { }
28+
impl MyTrait for (MyType,) { } //~ ERROR E0119
2929

3030
fn main() { }

src/test/compile-fail/issue-28568.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
struct MyStruct;
1212

1313
impl Drop for MyStruct {
14-
//~^ ERROR conflicting implementations of trait
14+
//~^ NOTE conflicting implementation is here
1515
fn drop(&mut self) { }
1616
}
1717

1818
impl Drop for MyStruct {
19-
//~^ NOTE conflicting implementation is here
19+
//~^ ERROR conflicting implementations of trait
2020
fn drop(&mut self) { }
2121
}
2222

0 commit comments

Comments
 (0)