Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 8eade3a

Browse files
committed
update tests
1 parent de53877 commit 8eade3a

19 files changed

+116
-11
lines changed

tests/ui/coherence/coherence-overlap-downstream-inherent.stderr renamed to tests/ui/coherence/coherence-overlap-downstream-inherent.next.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0592]: duplicate definitions with name `dummy`
2-
--> $DIR/coherence-overlap-downstream-inherent.rs:7:26
2+
--> $DIR/coherence-overlap-downstream-inherent.rs:10:26
33
|
44
LL | impl<T:Sugar> Sweet<T> { fn dummy(&self) { } }
55
| ^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
@@ -8,7 +8,7 @@ LL | impl<T:Fruit> Sweet<T> { fn dummy(&self) { } }
88
| --------------- other definition for `dummy`
99

1010
error[E0592]: duplicate definitions with name `f`
11-
--> $DIR/coherence-overlap-downstream-inherent.rs:13:38
11+
--> $DIR/coherence-overlap-downstream-inherent.rs:16:38
1212
|
1313
LL | impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
1414
| ^^^^^^^^^^^ duplicate definitions for `f`
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
error[E0592]: duplicate definitions with name `dummy`
2+
--> $DIR/coherence-overlap-downstream-inherent.rs:10:26
3+
|
4+
LL | impl<T:Sugar> Sweet<T> { fn dummy(&self) { } }
5+
| ^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
6+
LL |
7+
LL | impl<T:Fruit> Sweet<T> { fn dummy(&self) { } }
8+
| --------------- other definition for `dummy`
9+
10+
error[E0592]: duplicate definitions with name `f`
11+
--> $DIR/coherence-overlap-downstream-inherent.rs:16:38
12+
|
13+
LL | impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
14+
| ^^^^^^^^^^^ duplicate definitions for `f`
15+
LL |
16+
LL | impl<X> A<i32, X> { fn f(&self) {} }
17+
| ----------- other definition for `f`
18+
|
19+
= note: downstream crates may implement trait `Bar<_>` for type `i32`
20+
21+
error: aborting due to 2 previous errors
22+
23+
For more information about this error, try `rustc --explain E0592`.

tests/ui/coherence/coherence-overlap-downstream-inherent.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// revisions: old next
2+
//[next] compile-flags: -Ztrait-solver=next
3+
14
// Tests that we consider `T: Sugar + Fruit` to be ambiguous, even
25
// though no impls are found.
36

tests/ui/coherence/coherence-overlap-downstream.stderr renamed to tests/ui/coherence/coherence-overlap-downstream.next.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0119]: conflicting implementations of trait `Sweet`
2-
--> $DIR/coherence-overlap-downstream.rs:8:1
2+
--> $DIR/coherence-overlap-downstream.rs:11:1
33
|
44
LL | impl<T:Sugar> Sweet for T { }
55
| ------------------------- first implementation here
66
LL | impl<T:Fruit> Sweet for T { }
77
| ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
88

99
error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32`
10-
--> $DIR/coherence-overlap-downstream.rs:14:1
10+
--> $DIR/coherence-overlap-downstream.rs:17:1
1111
|
1212
LL | impl<X, T> Foo<X> for T where T: Bar<X> {}
1313
| ----------------------- first implementation here
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
error[E0119]: conflicting implementations of trait `Sweet`
2+
--> $DIR/coherence-overlap-downstream.rs:11:1
3+
|
4+
LL | impl<T:Sugar> Sweet for T { }
5+
| ------------------------- first implementation here
6+
LL | impl<T:Fruit> Sweet for T { }
7+
| ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
8+
9+
error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32`
10+
--> $DIR/coherence-overlap-downstream.rs:17:1
11+
|
12+
LL | impl<X, T> Foo<X> for T where T: Bar<X> {}
13+
| ----------------------- first implementation here
14+
LL | impl<X> Foo<X> for i32 {}
15+
| ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
16+
|
17+
= note: downstream crates may implement trait `Bar<_>` for type `i32`
18+
19+
error: aborting due to 2 previous errors
20+
21+
For more information about this error, try `rustc --explain E0119`.

tests/ui/coherence/coherence-overlap-downstream.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// revisions: old next
2+
//[next] compile-flags: -Ztrait-solver=next
3+
14
// Tests that we consider `T: Sugar + Fruit` to be ambiguous, even
25
// though no impls are found.
36

tests/ui/coherence/coherence-overlap-issue-23516-inherent.stderr renamed to tests/ui/coherence/coherence-overlap-issue-23516-inherent.next.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0592]: duplicate definitions with name `dummy`
2-
--> $DIR/coherence-overlap-issue-23516-inherent.rs:9:25
2+
--> $DIR/coherence-overlap-issue-23516-inherent.rs:12:25
33
|
44
LL | impl<T:Sugar> Cake<T> { fn dummy(&self) { } }
55
| ^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0592]: duplicate definitions with name `dummy`
2+
--> $DIR/coherence-overlap-issue-23516-inherent.rs:12:25
3+
|
4+
LL | impl<T:Sugar> Cake<T> { fn dummy(&self) { } }
5+
| ^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
6+
LL |
7+
LL | impl<U:Sugar> Cake<Box<U>> { fn dummy(&self) { } }
8+
| --------------- other definition for `dummy`
9+
|
10+
= note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
11+
12+
error: aborting due to previous error
13+
14+
For more information about this error, try `rustc --explain E0592`.

tests/ui/coherence/coherence-overlap-issue-23516-inherent.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// revisions: old next
2+
//[next] compile-flags: -Ztrait-solver=next
3+
14
// Tests that we consider `Box<U>: !Sugar` to be ambiguous, even
25
// though we see no impl of `Sugar` for `Box`. Therefore, an overlap
36
// error is reported for the following pair of impls (#23516).

tests/ui/coherence/coherence-overlap-issue-23516.stderr renamed to tests/ui/coherence/coherence-overlap-issue-23516.next.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0119]: conflicting implementations of trait `Sweet` for type `Box<_>`
2-
--> $DIR/coherence-overlap-issue-23516.rs:8:1
2+
--> $DIR/coherence-overlap-issue-23516.rs:11:1
33
|
44
LL | impl<T:Sugar> Sweet for T { }
55
| ------------------------- first implementation here

0 commit comments

Comments
 (0)