Skip to content

Commit a11e6c3

Browse files
Rollup merge of rust-lang#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
Lines changed: 8 additions & 0 deletions
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+
Lines changed: 7 additions & 4 deletions
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

Lines changed: 1 addition & 0 deletions
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 renamed to tests/ui/associated-types/defaults-unsound-62211-1.current.stderr

Lines changed: 8 additions & 8 deletions
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`
Lines changed: 13 additions & 0 deletions
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

Lines changed: 10 additions & 4 deletions
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 renamed to tests/ui/associated-types/defaults-unsound-62211-2.current.stderr

Lines changed: 8 additions & 8 deletions
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`
Lines changed: 13 additions & 0 deletions
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

Lines changed: 10 additions & 4 deletions
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

Lines changed: 1 addition & 0 deletions
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)]

0 commit comments

Comments
 (0)