update tests

This commit is contained in:
lcnr 2023-09-20 21:41:19 +02:00
parent de53877f8b
commit 8eade3aa71
19 changed files with 116 additions and 11 deletions

View File

@ -1,5 +1,5 @@
error[E0592]: duplicate definitions with name `dummy` error[E0592]: duplicate definitions with name `dummy`
--> $DIR/coherence-overlap-downstream-inherent.rs:7:26 --> $DIR/coherence-overlap-downstream-inherent.rs:10:26
| |
LL | impl<T:Sugar> Sweet<T> { fn dummy(&self) { } } LL | impl<T:Sugar> Sweet<T> { fn dummy(&self) { } }
| ^^^^^^^^^^^^^^^ duplicate definitions for `dummy` | ^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
@ -8,7 +8,7 @@ LL | impl<T:Fruit> Sweet<T> { fn dummy(&self) { } }
| --------------- other definition for `dummy` | --------------- other definition for `dummy`
error[E0592]: duplicate definitions with name `f` error[E0592]: duplicate definitions with name `f`
--> $DIR/coherence-overlap-downstream-inherent.rs:13:38 --> $DIR/coherence-overlap-downstream-inherent.rs:16:38
| |
LL | impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} } LL | impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
| ^^^^^^^^^^^ duplicate definitions for `f` | ^^^^^^^^^^^ duplicate definitions for `f`

View File

@ -0,0 +1,23 @@
error[E0592]: duplicate definitions with name `dummy`
--> $DIR/coherence-overlap-downstream-inherent.rs:10:26
|
LL | impl<T:Sugar> Sweet<T> { fn dummy(&self) { } }
| ^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
LL |
LL | impl<T:Fruit> Sweet<T> { fn dummy(&self) { } }
| --------------- other definition for `dummy`
error[E0592]: duplicate definitions with name `f`
--> $DIR/coherence-overlap-downstream-inherent.rs:16:38
|
LL | impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
| ^^^^^^^^^^^ duplicate definitions for `f`
LL |
LL | impl<X> A<i32, X> { fn f(&self) {} }
| ----------- other definition for `f`
|
= note: downstream crates may implement trait `Bar<_>` for type `i32`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0592`.

View File

@ -1,3 +1,6 @@
// revisions: old next
//[next] compile-flags: -Ztrait-solver=next
// Tests that we consider `T: Sugar + Fruit` to be ambiguous, even // Tests that we consider `T: Sugar + Fruit` to be ambiguous, even
// though no impls are found. // though no impls are found.

View File

@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `Sweet` error[E0119]: conflicting implementations of trait `Sweet`
--> $DIR/coherence-overlap-downstream.rs:8:1 --> $DIR/coherence-overlap-downstream.rs:11:1
| |
LL | impl<T:Sugar> Sweet for T { } LL | impl<T:Sugar> Sweet for T { }
| ------------------------- first implementation here | ------------------------- first implementation here
@ -7,7 +7,7 @@ LL | impl<T:Fruit> Sweet for T { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32` error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32`
--> $DIR/coherence-overlap-downstream.rs:14:1 --> $DIR/coherence-overlap-downstream.rs:17:1
| |
LL | impl<X, T> Foo<X> for T where T: Bar<X> {} LL | impl<X, T> Foo<X> for T where T: Bar<X> {}
| ----------------------- first implementation here | ----------------------- first implementation here

View File

@ -0,0 +1,21 @@
error[E0119]: conflicting implementations of trait `Sweet`
--> $DIR/coherence-overlap-downstream.rs:11:1
|
LL | impl<T:Sugar> Sweet for T { }
| ------------------------- first implementation here
LL | impl<T:Fruit> Sweet for T { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32`
--> $DIR/coherence-overlap-downstream.rs:17:1
|
LL | impl<X, T> Foo<X> for T where T: Bar<X> {}
| ----------------------- first implementation here
LL | impl<X> Foo<X> for i32 {}
| ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
|
= note: downstream crates may implement trait `Bar<_>` for type `i32`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0119`.

View File

@ -1,3 +1,6 @@
// revisions: old next
//[next] compile-flags: -Ztrait-solver=next
// Tests that we consider `T: Sugar + Fruit` to be ambiguous, even // Tests that we consider `T: Sugar + Fruit` to be ambiguous, even
// though no impls are found. // though no impls are found.

View File

@ -1,5 +1,5 @@
error[E0592]: duplicate definitions with name `dummy` error[E0592]: duplicate definitions with name `dummy`
--> $DIR/coherence-overlap-issue-23516-inherent.rs:9:25 --> $DIR/coherence-overlap-issue-23516-inherent.rs:12:25
| |
LL | impl<T:Sugar> Cake<T> { fn dummy(&self) { } } LL | impl<T:Sugar> Cake<T> { fn dummy(&self) { } }
| ^^^^^^^^^^^^^^^ duplicate definitions for `dummy` | ^^^^^^^^^^^^^^^ duplicate definitions for `dummy`

View File

@ -0,0 +1,14 @@
error[E0592]: duplicate definitions with name `dummy`
--> $DIR/coherence-overlap-issue-23516-inherent.rs:12:25
|
LL | impl<T:Sugar> Cake<T> { fn dummy(&self) { } }
| ^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
LL |
LL | impl<U:Sugar> Cake<Box<U>> { fn dummy(&self) { } }
| --------------- other definition for `dummy`
|
= note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0592`.

View File

@ -1,3 +1,6 @@
// revisions: old next
//[next] compile-flags: -Ztrait-solver=next
// Tests that we consider `Box<U>: !Sugar` to be ambiguous, even // Tests that we consider `Box<U>: !Sugar` to be ambiguous, even
// though we see no impl of `Sugar` for `Box`. Therefore, an overlap // though we see no impl of `Sugar` for `Box`. Therefore, an overlap
// error is reported for the following pair of impls (#23516). // error is reported for the following pair of impls (#23516).

View File

@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `Sweet` for type `Box<_>` error[E0119]: conflicting implementations of trait `Sweet` for type `Box<_>`
--> $DIR/coherence-overlap-issue-23516.rs:8:1 --> $DIR/coherence-overlap-issue-23516.rs:11:1
| |
LL | impl<T:Sugar> Sweet for T { } LL | impl<T:Sugar> Sweet for T { }
| ------------------------- first implementation here | ------------------------- first implementation here

View File

@ -0,0 +1,13 @@
error[E0119]: conflicting implementations of trait `Sweet` for type `Box<_>`
--> $DIR/coherence-overlap-issue-23516.rs:11:1
|
LL | impl<T:Sugar> Sweet for T { }
| ------------------------- first implementation here
LL | impl<U:Sugar> Sweet for Box<U> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Box<_>`
|
= note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0119`.

View File

@ -1,3 +1,6 @@
// revisions: old next
//[next] compile-flags: -Ztrait-solver=next
// Tests that we consider `Box<U>: !Sugar` to be ambiguous, even // Tests that we consider `Box<U>: !Sugar` to be ambiguous, even
// though we see no impl of `Sugar` for `Box`. Therefore, an overlap // though we see no impl of `Sugar` for `Box`. Therefore, an overlap
// error is reported for the following pair of impls (#23516). // error is reported for the following pair of impls (#23516).

View File

@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `From<()>` for type `S` error[E0119]: conflicting implementations of trait `From<()>` for type `S`
--> $DIR/inter-crate-ambiguity-causes-notes.rs:9:1 --> $DIR/inter-crate-ambiguity-causes-notes.rs:12:1
| |
LL | impl From<()> for S { LL | impl From<()> for S {
| ------------------- first implementation here | ------------------- first implementation here

View File

@ -0,0 +1,14 @@
error[E0119]: conflicting implementations of trait `From<()>` for type `S`
--> $DIR/inter-crate-ambiguity-causes-notes.rs:12:1
|
LL | impl From<()> for S {
| ------------------- first implementation here
...
LL | impl<I> From<I> for S
| ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `S`
|
= note: upstream crates may add a new impl of trait `std::iter::Iterator` for type `()` in future versions
error: aborting due to previous error
For more information about this error, try `rustc --explain E0119`.

View File

@ -1,3 +1,6 @@
// revisions: old next
//[next] compile-flags: -Ztrait-solver=next
struct S; struct S;
impl From<()> for S { impl From<()> for S {

View File

@ -1,6 +1,3 @@
// revisions: current next
//[next] compile-flags: -Ztrait-solver=next
#![feature(type_alias_impl_trait)] #![feature(type_alias_impl_trait)]
type T = impl Sized; type T = impl Sized;

View File

@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `Into<T>` for type `Foo` error[E0119]: conflicting implementations of trait `Into<T>` for type `Foo`
--> $DIR/coherence-treats-tait-ambig.rs:10:1 --> $DIR/coherence-treats-tait-ambig.rs:7:1
| |
LL | impl Into<T> for Foo { LL | impl Into<T> for Foo {
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^

View File

@ -5,6 +5,8 @@ LL | impl<T: TraitB> Overlaps<Box<T>> for <T as TraitB>::Assoc {}
| --------------------------------------------------------- first implementation here | --------------------------------------------------------- first implementation here
LL | impl<U: TraitB> Overlaps<U> for <U as TraitB>::Assoc {} LL | impl<U: TraitB> Overlaps<U> for <U as TraitB>::Assoc {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `<_ as TraitB>::Assoc` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `<_ as TraitB>::Assoc`
|
= note: downstream crates may implement trait `TraitB` for type `std::boxed::Box<_>`
error: aborting due to previous error error: aborting due to previous error

View File

@ -1,3 +1,7 @@
WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <<LocalTy as Overflow>::Assoc as std::marker::Sized>
WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <<LocalTy as Overflow>::Assoc as std::marker::Sized>
WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <<LocalTy as Overflow>::Assoc as std::marker::Sized>
WARN rustc_trait_selection::traits::coherence expected an unknowable trait ref: <<LocalTy as Overflow>::Assoc as std::marker::Sized>
error[E0119]: conflicting implementations of trait `Trait` for type `<LocalTy as Overflow>::Assoc` error[E0119]: conflicting implementations of trait `Trait` for type `<LocalTy as Overflow>::Assoc`
--> $DIR/trait_ref_is_knowable-norm-overflow.rs:17:1 --> $DIR/trait_ref_is_knowable-norm-overflow.rs:17:1
| |
@ -6,6 +10,8 @@ LL | impl<T: Copy> Trait for T {}
LL | struct LocalTy; LL | struct LocalTy;
LL | impl Trait for <LocalTy as Overflow>::Assoc {} LL | impl Trait for <LocalTy as Overflow>::Assoc {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `<LocalTy as Overflow>::Assoc` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `<LocalTy as Overflow>::Assoc`
|
= note: upstream crates may add a new impl of trait `std::marker::Copy` for type `<LocalTy as Overflow>::Assoc` in future versions
error: aborting due to previous error error: aborting due to previous error