Skip to content

Commit 01e6b43

Browse files
Mark some next-solver-behavior tests explicitly with revisions
1 parent 3830510 commit 01e6b43

17 files changed

+168
-44
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-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 {
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/generic-associated-types/assume-gat-normalization-for-nested-goals.stderr tests/ui/generic-associated-types/assume-gat-normalization-for-nested-goals.current.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
error[E0277]: the trait bound `<Self as Foo>::Bar<()>: Eq<i32>` is not satisfied
2-
--> $DIR/assume-gat-normalization-for-nested-goals.rs:6:30
2+
--> $DIR/assume-gat-normalization-for-nested-goals.rs:10:30
33
|
44
LL | type Bar<T>: Baz<Self> = i32;
55
| ^^^ the trait `Eq<i32>` is not implemented for `<Self as Foo>::Bar<()>`, which is required by `i32: Baz<Self>`
66
|
77
note: required for `i32` to implement `Baz<Self>`
8-
--> $DIR/assume-gat-normalization-for-nested-goals.rs:13:23
8+
--> $DIR/assume-gat-normalization-for-nested-goals.rs:17:23
99
|
1010
LL | impl<T: Foo + ?Sized> Baz<T> for i32 where T::Bar<()>: Eq<i32> {}
1111
| ^^^^^^ ^^^ ------- unsatisfied trait bound introduced here
1212
note: required by a bound in `Foo::Bar`
13-
--> $DIR/assume-gat-normalization-for-nested-goals.rs:6:18
13+
--> $DIR/assume-gat-normalization-for-nested-goals.rs:10:18
1414
|
1515
LL | type Bar<T>: Baz<Self> = i32;
1616
| ^^^^^^^^^ required by this bound in `Foo::Bar`

tests/ui/generic-associated-types/assume-gat-normalization-for-nested-goals.rs

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

37
#![feature(associated_type_defaults)]
48

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/issue-90014-tait2.rs:27:9
3+
|
4+
LL | fn make_fut(&self) -> Box<dyn for<'a> Trait<'a, Thing = Fut<'a>>> {
5+
| ------------------------------------------- expected `Box<(dyn for<'a> Trait<'a, Thing = Fut<'a>> + 'static)>` because of return type
6+
LL | Box::new((async { () },))
7+
| ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Trait<'a, Thing = Fut<'_>>>`, found `Box<(...,)>`
8+
|
9+
= note: expected struct `Box<(dyn for<'a> Trait<'a, Thing = Fut<'a>> + 'static)>`
10+
found struct `Box<({async block@$DIR/issue-90014-tait2.rs:27:19: 27:31},)>`
11+
= help: `({async block@$DIR/issue-90014-tait2.rs:27:19: 27:31},)` implements `Trait` so you could box the found value and coerce it to the trait object `Box<dyn Trait>`, you will have to change the expected type as well
12+
13+
error: aborting due to 1 previous error
14+
15+
For more information about this error, try `rustc --explain E0308`.

tests/ui/traits/pointee-tail-is-generic.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
#![feature(ptr_metadata)]
55
#![feature(type_alias_impl_trait)]
66

7-
type Opaque = impl std::future::Future;
7+
mod opaque {
8+
pub type Opaque = impl std::future::Future;
89

9-
fn opaque() -> Opaque {
10-
async {}
10+
fn opaque() -> Opaque {
11+
async {}
12+
}
1113
}
1214

1315
fn a<T>() {
@@ -16,7 +18,7 @@ fn a<T>() {
1618
// tail of ADT (which is a type param) is known to be sized
1719
is_thin::<std::cell::Cell<T>>();
1820
// opaque type is known to be sized
19-
is_thin::<Opaque>();
21+
is_thin::<opaque::Opaque>();
2022
}
2123

2224
fn a2<T: Iterator>() {

tests/ui/typeck/issue-103899.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
//@ check-fail
2-
//@ failure-status: 101
3-
//@ dont-check-compiler-stderr
4-
//@ known-bug: #103899
1+
//@ revisions: current next
2+
//@[next] compile-flags: -Znext-solver
3+
//@[next] check-pass
4+
//@ ignore-compare-mode-next-solver (explicit revisions)
5+
//@[current] check-fail
6+
//@[current] failure-status: 101
7+
//@[current] dont-check-compiler-stderr
8+
//@[current] known-bug: #103899
59

610
trait BaseWithAssoc {
711
type Assoc;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
error: the type `<[[[[[[u8]]]]]] as WellUnformed>::RequestNormalize` is not well-formed
2+
--> $DIR/wf-normalization-sized.rs:19:10
3+
|
4+
LL | const _: <[[[[[[u8]]]]]] as WellUnformed>::RequestNormalize = ();
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
error: the type `<[[[[[[u8]]]]]] as WellUnformed>::RequestNormalize` is not well-formed
8+
--> $DIR/wf-normalization-sized.rs:19:10
9+
|
10+
LL | const _: <[[[[[[u8]]]]]] as WellUnformed>::RequestNormalize = ();
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
|
13+
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
14+
15+
error: the type `<Vec<str> as WellUnformed>::RequestNormalize` is not well-formed
16+
--> $DIR/wf-normalization-sized.rs:22:10
17+
|
18+
LL | const _: <Vec<str> as WellUnformed>::RequestNormalize = ();
19+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20+
21+
error: the type `<Vec<str> as WellUnformed>::RequestNormalize` is not well-formed
22+
--> $DIR/wf-normalization-sized.rs:22:10
23+
|
24+
LL | const _: <Vec<str> as WellUnformed>::RequestNormalize = ();
25+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26+
|
27+
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
28+
29+
error: aborting due to 4 previous errors
30+

0 commit comments

Comments
 (0)