Skip to content

Commit a11e6c3

Browse files
Rollup merge of #122318 - compiler-errors:next-solver-tests, r=lcnr
Revision-related tweaks for next-solver tests 1. Add `ignore-compare-mode-next-solver` to any test that already has explicit `current next` revisions, since the test failures when testing with `--compare-mode=next-solver` will be false positives. 2. Explicitly add revisions to a handful of tests where we expect behavior to diverge. r? lcnr
2 parents 671fc18 + 01e6b43 commit a11e6c3

File tree

154 files changed

+669
-407
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+669
-407
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: the type `Foo::Bar<Vec<[u32]>>` is not well-formed
2+
--> $DIR/wf-check-skipped.rs:17:14
3+
|
4+
LL | fn main() -> Foo::Bar::<Vec<[u32]>> {}
5+
| ^^^^^^^^^^^^^^^^^^^^^^
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
//@ known-bug: #100041
2-
//@ check-pass
1+
//@ revisions: current next
2+
//@[next] compile-flags: -Znext-solver
3+
//@ ignore-compare-mode-next-solver (explicit revisions)
4+
//@[current] known-bug: #100041
5+
//@[current] check-pass
6+
// FIXME(inherent_associated_types): This should fail.
37

48
#![feature(inherent_associated_types)]
59
#![allow(incomplete_features)]
610

7-
// FIXME(inherent_associated_types): This should fail.
8-
911
struct Foo;
1012

1113
impl Foo {
1214
type Bar<T> = ();
1315
}
1416

1517
fn main() -> Foo::Bar::<Vec<[u32]>> {}
18+
//[next]~^ ERROR the type `Foo::Bar<Vec<[u32]>>` is not well-formed

tests/ui/associated-inherent-types/inference.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Testing inference capabilities.
22
//@ check-pass
33
//@ revisions: current next
4+
//@ ignore-compare-mode-next-solver (explicit revisions)
45
//@[next] compile-flags: -Znext-solver
56

67
#![feature(inherent_associated_types)]

tests/ui/associated-types/defaults-unsound-62211-1.stderr tests/ui/associated-types/defaults-unsound-62211-1.current.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error[E0277]: `Self` doesn't implement `std::fmt::Display`
2-
--> $DIR/defaults-unsound-62211-1.rs:20:96
2+
--> $DIR/defaults-unsound-62211-1.rs:26:96
33
|
44
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
55
| ^^^^ `Self` cannot be formatted with the default formatter
66
|
77
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
88
note: required by a bound in `UncheckedCopy::Output`
9-
--> $DIR/defaults-unsound-62211-1.rs:20:86
9+
--> $DIR/defaults-unsound-62211-1.rs:26:86
1010
|
1111
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
1212
| ^^^^^^^ required by this bound in `UncheckedCopy::Output`
@@ -16,13 +16,13 @@ LL | trait UncheckedCopy: Sized + std::fmt::Display {
1616
| +++++++++++++++++++
1717

1818
error[E0277]: cannot add-assign `&'static str` to `Self`
19-
--> $DIR/defaults-unsound-62211-1.rs:20:96
19+
--> $DIR/defaults-unsound-62211-1.rs:26:96
2020
|
2121
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
2222
| ^^^^ no implementation for `Self += &'static str`
2323
|
2424
note: required by a bound in `UncheckedCopy::Output`
25-
--> $DIR/defaults-unsound-62211-1.rs:20:47
25+
--> $DIR/defaults-unsound-62211-1.rs:26:47
2626
|
2727
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
2828
| ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
@@ -32,13 +32,13 @@ LL | trait UncheckedCopy: Sized + AddAssign<&'static str> {
3232
| +++++++++++++++++++++++++
3333

3434
error[E0277]: the trait bound `Self: Deref` is not satisfied
35-
--> $DIR/defaults-unsound-62211-1.rs:20:96
35+
--> $DIR/defaults-unsound-62211-1.rs:26:96
3636
|
3737
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
3838
| ^^^^ the trait `Deref` is not implemented for `Self`
3939
|
4040
note: required by a bound in `UncheckedCopy::Output`
41-
--> $DIR/defaults-unsound-62211-1.rs:20:25
41+
--> $DIR/defaults-unsound-62211-1.rs:26:25
4242
|
4343
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
4444
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
@@ -48,13 +48,13 @@ LL | trait UncheckedCopy: Sized + Deref {
4848
| +++++++
4949

5050
error[E0277]: the trait bound `Self: Copy` is not satisfied
51-
--> $DIR/defaults-unsound-62211-1.rs:20:96
51+
--> $DIR/defaults-unsound-62211-1.rs:26:96
5252
|
5353
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
5454
| ^^^^ the trait `Copy` is not implemented for `Self`
5555
|
5656
note: required by a bound in `UncheckedCopy::Output`
57-
--> $DIR/defaults-unsound-62211-1.rs:20:18
57+
--> $DIR/defaults-unsound-62211-1.rs:26:18
5858
|
5959
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
6060
| ^^^^ required by this bound in `UncheckedCopy::Output`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
2+
--> $DIR/defaults-unsound-62211-1.rs:52:5
3+
|
4+
LL | drop(origin);
5+
| ^^^^^------^
6+
| |
7+
| argument has type `<T as UncheckedCopy>::Output`
8+
|
9+
= note: use `let _ = ...` to ignore the expression or result
10+
= note: `#[warn(dropping_copy_types)]` on by default
11+
12+
warning: 1 warning emitted
13+

tests/ui/associated-types/defaults-unsound-62211-1.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
//@ revisions: current next
2+
//@[next] compile-flags: -Znext-solver
3+
//@ ignore-compare-mode-next-solver (explicit revisions)
4+
//@[next] known-bug: rust-lang/trait-system-refactor-initiative#46
5+
//@[next] check-pass
6+
17
//! Regression test for https://github.com/rust-lang/rust/issues/62211
28
//!
39
//! The old implementation of defaults did not check whether the provided
@@ -18,10 +24,10 @@ trait UncheckedCopy: Sized {
1824
// This Output is said to be Copy. Yet we default to Self
1925
// and it's accepted, not knowing if Self ineed is Copy
2026
type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
21-
//~^ ERROR the trait bound `Self: Copy` is not satisfied
22-
//~| ERROR the trait bound `Self: Deref` is not satisfied
23-
//~| ERROR cannot add-assign `&'static str` to `Self`
24-
//~| ERROR `Self` doesn't implement `std::fmt::Display`
27+
//[current]~^ ERROR the trait bound `Self: Copy` is not satisfied
28+
//[current]~| ERROR the trait bound `Self: Deref` is not satisfied
29+
//[current]~| ERROR cannot add-assign `&'static str` to `Self`
30+
//[current]~| ERROR `Self` doesn't implement `std::fmt::Display`
2531

2632
// We said the Output type was Copy, so we can Copy it freely!
2733
fn unchecked_copy(other: &Self::Output) -> Self::Output {

tests/ui/associated-types/defaults-unsound-62211-2.stderr tests/ui/associated-types/defaults-unsound-62211-2.current.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error[E0277]: `Self` doesn't implement `std::fmt::Display`
2-
--> $DIR/defaults-unsound-62211-2.rs:20:96
2+
--> $DIR/defaults-unsound-62211-2.rs:26:96
33
|
44
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
55
| ^^^^ `Self` cannot be formatted with the default formatter
66
|
77
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
88
note: required by a bound in `UncheckedCopy::Output`
9-
--> $DIR/defaults-unsound-62211-2.rs:20:86
9+
--> $DIR/defaults-unsound-62211-2.rs:26:86
1010
|
1111
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
1212
| ^^^^^^^ required by this bound in `UncheckedCopy::Output`
@@ -16,13 +16,13 @@ LL | trait UncheckedCopy: Sized + std::fmt::Display {
1616
| +++++++++++++++++++
1717

1818
error[E0277]: cannot add-assign `&'static str` to `Self`
19-
--> $DIR/defaults-unsound-62211-2.rs:20:96
19+
--> $DIR/defaults-unsound-62211-2.rs:26:96
2020
|
2121
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
2222
| ^^^^ no implementation for `Self += &'static str`
2323
|
2424
note: required by a bound in `UncheckedCopy::Output`
25-
--> $DIR/defaults-unsound-62211-2.rs:20:47
25+
--> $DIR/defaults-unsound-62211-2.rs:26:47
2626
|
2727
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
2828
| ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
@@ -32,13 +32,13 @@ LL | trait UncheckedCopy: Sized + AddAssign<&'static str> {
3232
| +++++++++++++++++++++++++
3333

3434
error[E0277]: the trait bound `Self: Deref` is not satisfied
35-
--> $DIR/defaults-unsound-62211-2.rs:20:96
35+
--> $DIR/defaults-unsound-62211-2.rs:26:96
3636
|
3737
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
3838
| ^^^^ the trait `Deref` is not implemented for `Self`
3939
|
4040
note: required by a bound in `UncheckedCopy::Output`
41-
--> $DIR/defaults-unsound-62211-2.rs:20:25
41+
--> $DIR/defaults-unsound-62211-2.rs:26:25
4242
|
4343
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
4444
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
@@ -48,13 +48,13 @@ LL | trait UncheckedCopy: Sized + Deref {
4848
| +++++++
4949

5050
error[E0277]: the trait bound `Self: Copy` is not satisfied
51-
--> $DIR/defaults-unsound-62211-2.rs:20:96
51+
--> $DIR/defaults-unsound-62211-2.rs:26:96
5252
|
5353
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
5454
| ^^^^ the trait `Copy` is not implemented for `Self`
5555
|
5656
note: required by a bound in `UncheckedCopy::Output`
57-
--> $DIR/defaults-unsound-62211-2.rs:20:18
57+
--> $DIR/defaults-unsound-62211-2.rs:26:18
5858
|
5959
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
6060
| ^^^^ required by this bound in `UncheckedCopy::Output`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
2+
--> $DIR/defaults-unsound-62211-2.rs:52:5
3+
|
4+
LL | drop(origin);
5+
| ^^^^^------^
6+
| |
7+
| argument has type `<T as UncheckedCopy>::Output`
8+
|
9+
= note: use `let _ = ...` to ignore the expression or result
10+
= note: `#[warn(dropping_copy_types)]` on by default
11+
12+
warning: 1 warning emitted
13+

tests/ui/associated-types/defaults-unsound-62211-2.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
//@ revisions: current next
2+
//@[next] compile-flags: -Znext-solver
3+
//@ ignore-compare-mode-next-solver (explicit revisions)
4+
//@[next] known-bug: rust-lang/trait-system-refactor-initiative#46
5+
//@[next] check-pass
6+
17
//! Regression test for https://github.com/rust-lang/rust/issues/62211
28
//!
39
//! The old implementation of defaults did not check whether the provided
@@ -18,10 +24,10 @@ trait UncheckedCopy: Sized {
1824
// This Output is said to be Copy. Yet we default to Self
1925
// and it's accepted, not knowing if Self ineed is Copy
2026
type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
21-
//~^ ERROR the trait bound `Self: Copy` is not satisfied
22-
//~| ERROR the trait bound `Self: Deref` is not satisfied
23-
//~| ERROR cannot add-assign `&'static str` to `Self`
24-
//~| ERROR `Self` doesn't implement `std::fmt::Display`
27+
//[current]~^ ERROR the trait bound `Self: Copy` is not satisfied
28+
//[current]~| ERROR the trait bound `Self: Deref` is not satisfied
29+
//[current]~| ERROR cannot add-assign `&'static str` to `Self`
30+
//[current]~| ERROR `Self` doesn't implement `std::fmt::Display`
2531

2632
// We said the Output type was Copy, so we can Copy it freely!
2733
fn unchecked_copy(other: &Self::Output) -> Self::Output {

tests/ui/async-await/async-closures/is-fn.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//@ edition:2021
33
//@ build-pass
44
//@ revisions: current next
5+
//@ ignore-compare-mode-next-solver (explicit revisions)
56
//@[next] compile-flags: -Znext-solver
67

78
#![feature(async_closure)]

tests/ui/async-await/async-closures/once.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//@ edition:2021
33
//@ build-pass
44
//@ revisions: current next
5+
//@ ignore-compare-mode-next-solver (explicit revisions)
56
//@[next] compile-flags: -Znext-solver
67

78
#![feature(async_closure)]

tests/ui/async-await/async-fn/higher-ranked-async-fn.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ aux-build:block-on.rs
22
//@ edition:2018
33
//@ revisions: current next
4+
//@ ignore-compare-mode-next-solver (explicit revisions)
45
//@[next] compile-flags: -Znext-solver
56
//@ build-pass (since it ICEs during mono)
67

tests/ui/async-await/async-fn/project.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@ edition:2018
22
//@ revisions: current next
3+
//@ ignore-compare-mode-next-solver (explicit revisions)
34
//@[next] compile-flags: -Znext-solver
45
//@ check-pass
56

tests/ui/async-await/normalize-output-in-signature-deduction.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@ edition:2021
22
//@ revisions: current next
3+
//@ ignore-compare-mode-next-solver (explicit revisions)
34
//@[next] compile-flags: -Znext-solver
45
//@ check-pass
56

tests/ui/async-await/return-type-notation/normalizing-self-auto-trait-issue-109924.current.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
2-
--> $DIR/normalizing-self-auto-trait-issue-109924.rs:6:12
2+
--> $DIR/normalizing-self-auto-trait-issue-109924.rs:7:12
33
|
44
LL | #![feature(return_type_notation)]
55
| ^^^^^^^^^^^^^^^^^^^^

tests/ui/async-await/return-type-notation/normalizing-self-auto-trait-issue-109924.next.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
2-
--> $DIR/normalizing-self-auto-trait-issue-109924.rs:6:12
2+
--> $DIR/normalizing-self-auto-trait-issue-109924.rs:7:12
33
|
44
LL | #![feature(return_type_notation)]
55
| ^^^^^^^^^^^^^^^^^^^^

tests/ui/async-await/return-type-notation/normalizing-self-auto-trait-issue-109924.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@ check-pass
22
//@ revisions: current next
3+
//@ ignore-compare-mode-next-solver (explicit revisions)
34
//@[next] compile-flags: -Znext-solver
45
//@ edition:2021
56

tests/ui/auto-traits/issue-23080-2.current.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0380]: auto traits cannot have associated items
2-
--> $DIR/issue-23080-2.rs:8:10
2+
--> $DIR/issue-23080-2.rs:9:10
33
|
44
LL | unsafe auto trait Trait {
55
| ----- auto traits cannot have associated items

tests/ui/auto-traits/issue-23080-2.next.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0380]: auto traits cannot have associated items
2-
--> $DIR/issue-23080-2.rs:8:10
2+
--> $DIR/issue-23080-2.rs:9:10
33
|
44
LL | unsafe auto trait Trait {
55
| ----- auto traits cannot have associated items

tests/ui/auto-traits/issue-23080-2.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//@ revisions: current next
2+
//@ ignore-compare-mode-next-solver (explicit revisions)
23
//@[next] compile-flags: -Znext-solver
34

45
#![feature(auto_traits)]

tests/ui/closures/infer-signature-from-impl.next.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0282]: type annotations needed
2-
--> $DIR/infer-signature-from-impl.rs:17:16
2+
--> $DIR/infer-signature-from-impl.rs:18:16
33
|
44
LL | needs_foo(|x| {
55
| ^

tests/ui/closures/infer-signature-from-impl.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//@ revisions: current next
2+
//@ ignore-compare-mode-next-solver (explicit revisions)
23
//@[next] compile-flags: -Znext-solver
34
//@[next] known-bug: trait-system-refactor-initiative#71
45
//@[current] check-pass
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0284]: type annotations needed: cannot satisfy `<dyn Object<U, Output = T> as Object<U>>::Output == T`
2+
--> $DIR/indirect-impl-for-trait-obj-coherence.rs:25:41
3+
|
4+
LL | foo::<dyn Object<U, Output = T>, U>(x)
5+
| ^ cannot satisfy `<dyn Object<U, Output = T> as Object<U>>::Output == T`
6+
7+
error: aborting due to 1 previous error
8+
9+
For more information about this error, try `rustc --explain E0284`.

tests/ui/coherence/indirect-impl-for-trait-obj-coherence.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
//@ check-pass
2-
//@ known-bug: #57893
1+
//@ revisions: current next
2+
//@[next] compile-flags: -Znext-solver
3+
//@ ignore-compare-mode-next-solver (explicit revisions)
4+
//@[current] check-pass
5+
//@[current] known-bug: #57893
36

47
// Should fail. Because we see an impl that uses a certain associated type, we
58
// type-check assuming that impl is used. However, this conflicts with the
@@ -20,6 +23,7 @@ fn foo<T: ?Sized, U>(x: <T as Object<U>>::Output) -> U {
2023
#[allow(dead_code)]
2124
fn transmute<T, U>(x: T) -> U {
2225
foo::<dyn Object<U, Output = T>, U>(x)
26+
//[next]~^ ERROR type annotations needed: cannot satisfy `<dyn Object<U, Output = T> as Object<U>>::Output == T`
2327
}
2428

2529
fn main() {}

tests/ui/coherence/normalize-for-errors.current.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0119]: conflicting implementations of trait `MyTrait<_>` for type `(Box<(MyType,)>, _)`
2-
--> $DIR/normalize-for-errors.rs:16:1
2+
--> $DIR/normalize-for-errors.rs:17:1
33
|
44
LL | impl<T: Copy, S: Iterator> MyTrait<S> for (T, S::Item) {}
55
| ------------------------------------------------------ first implementation here

tests/ui/coherence/normalize-for-errors.next.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0119]: conflicting implementations of trait `MyTrait<_>` for type `(Box<(MyType,)>, <_ as Iterator>::Item)`
2-
--> $DIR/normalize-for-errors.rs:16:1
2+
--> $DIR/normalize-for-errors.rs:17:1
33
|
44
LL | impl<T: Copy, S: Iterator> MyTrait<S> for (T, S::Item) {}
55
| ------------------------------------------------------ first implementation here

tests/ui/coherence/normalize-for-errors.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//@ revisions: current next
2+
//@ ignore-compare-mode-next-solver (explicit revisions)
23
//@[next] compile-flags: -Znext-solver
34

45
struct MyType;

0 commit comments

Comments
 (0)