Skip to content

Commit a8f29e1

Browse files
committed
update tests
1 parent 64c3bde commit a8f29e1

20 files changed

+132
-10
lines changed

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

+2-2
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`
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

+3
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

+2-2
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
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

+3
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

+1-1
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`
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

+3
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

+1-1
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error[E0119]: conflicting implementations of trait `Sweet` for type `Box<_>`
2+
--> $DIR/coherence-overlap-issue-23516.rs:11:1
3+
|
4+
LL | impl<T:Sugar> Sweet for T { }
5+
| ------------------------- first implementation here
6+
LL | impl<U:Sugar> Sweet for Box<U> { }
7+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Box<_>`
8+
|
9+
= note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
10+
11+
error: aborting due to previous error
12+
13+
For more information about this error, try `rustc --explain E0119`.

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

+3
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/inter-crate-ambiguity-causes-notes.stderr renamed to tests/ui/coherence/inter-crate-ambiguity-causes-notes.next.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0119]: conflicting implementations of trait `From<()>` for type `S`
2-
--> $DIR/inter-crate-ambiguity-causes-notes.rs:9:1
2+
--> $DIR/inter-crate-ambiguity-causes-notes.rs:12:1
33
|
44
LL | impl From<()> for S {
55
| ------------------- first implementation here
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0119]: conflicting implementations of trait `From<()>` for type `S`
2+
--> $DIR/inter-crate-ambiguity-causes-notes.rs:12:1
3+
|
4+
LL | impl From<()> for S {
5+
| ------------------- first implementation here
6+
...
7+
LL | impl<I> From<I> for S
8+
| ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `S`
9+
|
10+
= note: upstream crates may add a new impl of trait `std::iter::Iterator` for type `()` in future versions
11+
12+
error: aborting due to previous error
13+
14+
For more information about this error, try `rustc --explain E0119`.

tests/ui/coherence/inter-crate-ambiguity-causes-notes.rs

+3
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
struct S;
25

36
impl From<()> for S {

tests/ui/impl-trait/coherence-treats-tait-ambig.next.stderr

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <T as std::convert::From<Foo>>
2+
WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <T as std::convert::From<Foo>>
3+
WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <T as std::convert::From<Foo>>
4+
WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <T as std::convert::From<Foo>>
15
error[E0119]: conflicting implementations of trait `Into<T>` for type `Foo`
26
--> $DIR/coherence-treats-tait-ambig.rs:10:1
37
|

tests/ui/impl-trait/coherence-treats-tait-ambig.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// revisions: current next
2-
//[next] compile-flags: -Ztrait-solver=next
3-
41
#![feature(type_alias_impl_trait)]
52

63
type T = impl Sized;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error[E0119]: conflicting implementations of trait `Into<T>` for type `Foo`
2+
--> $DIR/coherence-treats-tait-ambig.rs:7:1
3+
|
4+
LL | impl Into<T> for Foo {
5+
| ^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: conflicting implementation in crate `core`:
8+
- impl<T, U> Into<U> for T
9+
where U: From<T>;
10+
11+
error: aborting due to previous error
12+
13+
For more information about this error, try `rustc --explain E0119`.

tests/ui/traits/new-solver/alias_eq_substs_eq_not_intercrate.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ LL | impl<T: TraitB> Overlaps<Box<T>> for <T as TraitB>::Assoc {}
55
| --------------------------------------------------------- first implementation here
66
LL | impl<U: TraitB> Overlaps<U> for <U as TraitB>::Assoc {}
77
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `<_ as TraitB>::Assoc`
8+
|
9+
= note: downstream crates may implement trait `TraitB` for type `std::boxed::Box<_>`
810

911
error: aborting due to previous error
1012

tests/ui/traits/new-solver/coherence/trait_ref_is_knowable-norm-overflow.stderr

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <<LocalTy as Overflow>::Assoc as std::marker::Sized>
2+
WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <<LocalTy as Overflow>::Assoc as std::marker::Sized>
3+
WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <<LocalTy as Overflow>::Assoc as std::marker::Sized>
4+
WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <<LocalTy as Overflow>::Assoc as std::marker::Sized>
15
error[E0119]: conflicting implementations of trait `Trait` for type `<LocalTy as Overflow>::Assoc`
26
--> $DIR/trait_ref_is_knowable-norm-overflow.rs:17:1
37
|
@@ -6,6 +10,8 @@ LL | impl<T: Copy> Trait for T {}
610
LL | struct LocalTy;
711
LL | impl Trait for <LocalTy as Overflow>::Assoc {}
812
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `<LocalTy as Overflow>::Assoc`
13+
|
14+
= note: upstream crates may add a new impl of trait `std::marker::Copy` for type `<LocalTy as Overflow>::Assoc` in future versions
915

1016
error: aborting due to previous error
1117

0 commit comments

Comments
 (0)