Mark some next-solver-behavior tests explicitly with revisions

This commit is contained in:
Michael Goulet 2024-03-10 22:25:32 -04:00
parent 383051092f
commit 01e6b43a07
17 changed files with 168 additions and 44 deletions

View File

@ -0,0 +1,8 @@
error: the type `Foo::Bar<Vec<[u32]>>` is not well-formed
--> $DIR/wf-check-skipped.rs:17:14
|
LL | fn main() -> Foo::Bar::<Vec<[u32]>> {}
| ^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 1 previous error

View File

@ -1,11 +1,13 @@
//@ known-bug: #100041
//@ check-pass
//@ revisions: current next
//@[next] compile-flags: -Znext-solver
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[current] known-bug: #100041
//@[current] check-pass
// FIXME(inherent_associated_types): This should fail.
#![feature(inherent_associated_types)]
#![allow(incomplete_features)]
// FIXME(inherent_associated_types): This should fail.
struct Foo;
impl Foo {
@ -13,3 +15,4 @@ impl Foo {
}
fn main() -> Foo::Bar::<Vec<[u32]>> {}
//[next]~^ ERROR the type `Foo::Bar<Vec<[u32]>>` is not well-formed

View File

@ -1,12 +1,12 @@
error[E0277]: `Self` doesn't implement `std::fmt::Display`
--> $DIR/defaults-unsound-62211-1.rs:20:96
--> $DIR/defaults-unsound-62211-1.rs:26:96
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
| ^^^^ `Self` cannot be formatted with the default formatter
|
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
note: required by a bound in `UncheckedCopy::Output`
--> $DIR/defaults-unsound-62211-1.rs:20:86
--> $DIR/defaults-unsound-62211-1.rs:26:86
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
| ^^^^^^^ required by this bound in `UncheckedCopy::Output`
@ -16,13 +16,13 @@ LL | trait UncheckedCopy: Sized + std::fmt::Display {
| +++++++++++++++++++
error[E0277]: cannot add-assign `&'static str` to `Self`
--> $DIR/defaults-unsound-62211-1.rs:20:96
--> $DIR/defaults-unsound-62211-1.rs:26:96
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
| ^^^^ no implementation for `Self += &'static str`
|
note: required by a bound in `UncheckedCopy::Output`
--> $DIR/defaults-unsound-62211-1.rs:20:47
--> $DIR/defaults-unsound-62211-1.rs:26:47
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
| ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
@ -32,13 +32,13 @@ LL | trait UncheckedCopy: Sized + AddAssign<&'static str> {
| +++++++++++++++++++++++++
error[E0277]: the trait bound `Self: Deref` is not satisfied
--> $DIR/defaults-unsound-62211-1.rs:20:96
--> $DIR/defaults-unsound-62211-1.rs:26:96
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
| ^^^^ the trait `Deref` is not implemented for `Self`
|
note: required by a bound in `UncheckedCopy::Output`
--> $DIR/defaults-unsound-62211-1.rs:20:25
--> $DIR/defaults-unsound-62211-1.rs:26:25
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
@ -48,13 +48,13 @@ LL | trait UncheckedCopy: Sized + Deref {
| +++++++
error[E0277]: the trait bound `Self: Copy` is not satisfied
--> $DIR/defaults-unsound-62211-1.rs:20:96
--> $DIR/defaults-unsound-62211-1.rs:26:96
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
| ^^^^ the trait `Copy` is not implemented for `Self`
|
note: required by a bound in `UncheckedCopy::Output`
--> $DIR/defaults-unsound-62211-1.rs:20:18
--> $DIR/defaults-unsound-62211-1.rs:26:18
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
| ^^^^ required by this bound in `UncheckedCopy::Output`

View File

@ -0,0 +1,13 @@
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
--> $DIR/defaults-unsound-62211-1.rs:52:5
|
LL | drop(origin);
| ^^^^^------^
| |
| argument has type `<T as UncheckedCopy>::Output`
|
= note: use `let _ = ...` to ignore the expression or result
= note: `#[warn(dropping_copy_types)]` on by default
warning: 1 warning emitted

View File

@ -1,3 +1,9 @@
//@ revisions: current next
//@[next] compile-flags: -Znext-solver
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] known-bug: rust-lang/trait-system-refactor-initiative#46
//@[next] check-pass
//! Regression test for https://github.com/rust-lang/rust/issues/62211
//!
//! The old implementation of defaults did not check whether the provided
@ -18,10 +24,10 @@ trait UncheckedCopy: Sized {
// This Output is said to be Copy. Yet we default to Self
// and it's accepted, not knowing if Self ineed is Copy
type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
//~^ ERROR the trait bound `Self: Copy` is not satisfied
//~| ERROR the trait bound `Self: Deref` is not satisfied
//~| ERROR cannot add-assign `&'static str` to `Self`
//~| ERROR `Self` doesn't implement `std::fmt::Display`
//[current]~^ ERROR the trait bound `Self: Copy` is not satisfied
//[current]~| ERROR the trait bound `Self: Deref` is not satisfied
//[current]~| ERROR cannot add-assign `&'static str` to `Self`
//[current]~| ERROR `Self` doesn't implement `std::fmt::Display`
// We said the Output type was Copy, so we can Copy it freely!
fn unchecked_copy(other: &Self::Output) -> Self::Output {

View File

@ -1,12 +1,12 @@
error[E0277]: `Self` doesn't implement `std::fmt::Display`
--> $DIR/defaults-unsound-62211-2.rs:20:96
--> $DIR/defaults-unsound-62211-2.rs:26:96
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
| ^^^^ `Self` cannot be formatted with the default formatter
|
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
note: required by a bound in `UncheckedCopy::Output`
--> $DIR/defaults-unsound-62211-2.rs:20:86
--> $DIR/defaults-unsound-62211-2.rs:26:86
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
| ^^^^^^^ required by this bound in `UncheckedCopy::Output`
@ -16,13 +16,13 @@ LL | trait UncheckedCopy: Sized + std::fmt::Display {
| +++++++++++++++++++
error[E0277]: cannot add-assign `&'static str` to `Self`
--> $DIR/defaults-unsound-62211-2.rs:20:96
--> $DIR/defaults-unsound-62211-2.rs:26:96
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
| ^^^^ no implementation for `Self += &'static str`
|
note: required by a bound in `UncheckedCopy::Output`
--> $DIR/defaults-unsound-62211-2.rs:20:47
--> $DIR/defaults-unsound-62211-2.rs:26:47
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
| ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
@ -32,13 +32,13 @@ LL | trait UncheckedCopy: Sized + AddAssign<&'static str> {
| +++++++++++++++++++++++++
error[E0277]: the trait bound `Self: Deref` is not satisfied
--> $DIR/defaults-unsound-62211-2.rs:20:96
--> $DIR/defaults-unsound-62211-2.rs:26:96
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
| ^^^^ the trait `Deref` is not implemented for `Self`
|
note: required by a bound in `UncheckedCopy::Output`
--> $DIR/defaults-unsound-62211-2.rs:20:25
--> $DIR/defaults-unsound-62211-2.rs:26:25
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
@ -48,13 +48,13 @@ LL | trait UncheckedCopy: Sized + Deref {
| +++++++
error[E0277]: the trait bound `Self: Copy` is not satisfied
--> $DIR/defaults-unsound-62211-2.rs:20:96
--> $DIR/defaults-unsound-62211-2.rs:26:96
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
| ^^^^ the trait `Copy` is not implemented for `Self`
|
note: required by a bound in `UncheckedCopy::Output`
--> $DIR/defaults-unsound-62211-2.rs:20:18
--> $DIR/defaults-unsound-62211-2.rs:26:18
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
| ^^^^ required by this bound in `UncheckedCopy::Output`

View File

@ -0,0 +1,13 @@
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
--> $DIR/defaults-unsound-62211-2.rs:52:5
|
LL | drop(origin);
| ^^^^^------^
| |
| argument has type `<T as UncheckedCopy>::Output`
|
= note: use `let _ = ...` to ignore the expression or result
= note: `#[warn(dropping_copy_types)]` on by default
warning: 1 warning emitted

View File

@ -1,3 +1,9 @@
//@ revisions: current next
//@[next] compile-flags: -Znext-solver
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] known-bug: rust-lang/trait-system-refactor-initiative#46
//@[next] check-pass
//! Regression test for https://github.com/rust-lang/rust/issues/62211
//!
//! The old implementation of defaults did not check whether the provided
@ -18,10 +24,10 @@ trait UncheckedCopy: Sized {
// This Output is said to be Copy. Yet we default to Self
// and it's accepted, not knowing if Self ineed is Copy
type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
//~^ ERROR the trait bound `Self: Copy` is not satisfied
//~| ERROR the trait bound `Self: Deref` is not satisfied
//~| ERROR cannot add-assign `&'static str` to `Self`
//~| ERROR `Self` doesn't implement `std::fmt::Display`
//[current]~^ ERROR the trait bound `Self: Copy` is not satisfied
//[current]~| ERROR the trait bound `Self: Deref` is not satisfied
//[current]~| ERROR cannot add-assign `&'static str` to `Self`
//[current]~| ERROR `Self` doesn't implement `std::fmt::Display`
// We said the Output type was Copy, so we can Copy it freely!
fn unchecked_copy(other: &Self::Output) -> Self::Output {

View File

@ -0,0 +1,9 @@
error[E0284]: type annotations needed: cannot satisfy `<dyn Object<U, Output = T> as Object<U>>::Output == T`
--> $DIR/indirect-impl-for-trait-obj-coherence.rs:25:41
|
LL | foo::<dyn Object<U, Output = T>, U>(x)
| ^ cannot satisfy `<dyn Object<U, Output = T> as Object<U>>::Output == T`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0284`.

View File

@ -1,5 +1,8 @@
//@ check-pass
//@ known-bug: #57893
//@ revisions: current next
//@[next] compile-flags: -Znext-solver
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[current] check-pass
//@[current] known-bug: #57893
// Should fail. Because we see an impl that uses a certain associated type, we
// 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 {
#[allow(dead_code)]
fn transmute<T, U>(x: T) -> U {
foo::<dyn Object<U, Output = T>, U>(x)
//[next]~^ ERROR type annotations needed: cannot satisfy `<dyn Object<U, Output = T> as Object<U>>::Output == T`
}
fn main() {}

View File

@ -1,16 +1,16 @@
error[E0277]: the trait bound `<Self as Foo>::Bar<()>: Eq<i32>` is not satisfied
--> $DIR/assume-gat-normalization-for-nested-goals.rs:6:30
--> $DIR/assume-gat-normalization-for-nested-goals.rs:10:30
|
LL | type Bar<T>: Baz<Self> = i32;
| ^^^ the trait `Eq<i32>` is not implemented for `<Self as Foo>::Bar<()>`, which is required by `i32: Baz<Self>`
|
note: required for `i32` to implement `Baz<Self>`
--> $DIR/assume-gat-normalization-for-nested-goals.rs:13:23
--> $DIR/assume-gat-normalization-for-nested-goals.rs:17:23
|
LL | impl<T: Foo + ?Sized> Baz<T> for i32 where T::Bar<()>: Eq<i32> {}
| ^^^^^^ ^^^ ------- unsatisfied trait bound introduced here
note: required by a bound in `Foo::Bar`
--> $DIR/assume-gat-normalization-for-nested-goals.rs:6:18
--> $DIR/assume-gat-normalization-for-nested-goals.rs:10:18
|
LL | type Bar<T>: Baz<Self> = i32;
| ^^^^^^^^^ required by this bound in `Foo::Bar`

View File

@ -1,4 +1,8 @@
//@ known-bug: #117606
//@ revisions: current next
//@[next] compile-flags: -Znext-solver
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[current] known-bug: #117606
//@[next] check-pass
#![feature(associated_type_defaults)]

View File

@ -0,0 +1,15 @@
error[E0308]: mismatched types
--> $DIR/issue-90014-tait2.rs:27:9
|
LL | fn make_fut(&self) -> Box<dyn for<'a> Trait<'a, Thing = Fut<'a>>> {
| ------------------------------------------- expected `Box<(dyn for<'a> Trait<'a, Thing = Fut<'a>> + 'static)>` because of return type
LL | Box::new((async { () },))
| ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Trait<'a, Thing = Fut<'_>>>`, found `Box<(...,)>`
|
= note: expected struct `Box<(dyn for<'a> Trait<'a, Thing = Fut<'a>> + 'static)>`
found struct `Box<({async block@$DIR/issue-90014-tait2.rs:27:19: 27:31},)>`
= 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
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0308`.

View File

@ -4,10 +4,12 @@
#![feature(ptr_metadata)]
#![feature(type_alias_impl_trait)]
type Opaque = impl std::future::Future;
mod opaque {
pub type Opaque = impl std::future::Future;
fn opaque() -> Opaque {
async {}
fn opaque() -> Opaque {
async {}
}
}
fn a<T>() {
@ -16,7 +18,7 @@ fn a<T>() {
// tail of ADT (which is a type param) is known to be sized
is_thin::<std::cell::Cell<T>>();
// opaque type is known to be sized
is_thin::<Opaque>();
is_thin::<opaque::Opaque>();
}
fn a2<T: Iterator>() {

View File

@ -1,7 +1,11 @@
//@ check-fail
//@ failure-status: 101
//@ dont-check-compiler-stderr
//@ known-bug: #103899
//@ revisions: current next
//@[next] compile-flags: -Znext-solver
//@[next] check-pass
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[current] check-fail
//@[current] failure-status: 101
//@[current] dont-check-compiler-stderr
//@[current] known-bug: #103899
trait BaseWithAssoc {
type Assoc;

View File

@ -0,0 +1,30 @@
error: the type `<[[[[[[u8]]]]]] as WellUnformed>::RequestNormalize` is not well-formed
--> $DIR/wf-normalization-sized.rs:19:10
|
LL | const _: <[[[[[[u8]]]]]] as WellUnformed>::RequestNormalize = ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the type `<[[[[[[u8]]]]]] as WellUnformed>::RequestNormalize` is not well-formed
--> $DIR/wf-normalization-sized.rs:19:10
|
LL | const _: <[[[[[[u8]]]]]] as WellUnformed>::RequestNormalize = ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: the type `<Vec<str> as WellUnformed>::RequestNormalize` is not well-formed
--> $DIR/wf-normalization-sized.rs:22:10
|
LL | const _: <Vec<str> as WellUnformed>::RequestNormalize = ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the type `<Vec<str> as WellUnformed>::RequestNormalize` is not well-formed
--> $DIR/wf-normalization-sized.rs:22:10
|
LL | const _: <Vec<str> as WellUnformed>::RequestNormalize = ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: aborting due to 4 previous errors

View File

@ -1,5 +1,8 @@
//@ check-pass
//@ known-bug: #100041
//@ revisions: current next
//@[next] compile-flags: -Znext-solver
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[current] check-pass
//@[current] known-bug: #100041
// Should fail. Normalization can bypass well-formedness checking.
// `[[[[[[u8]]]]]]` is not a well-formed type since size of type `[u8]` cannot
@ -14,6 +17,10 @@ impl<T: ?Sized> WellUnformed for T {
}
const _: <[[[[[[u8]]]]]] as WellUnformed>::RequestNormalize = ();
//[next]~^ the type
//[next]~| the type
const _: <Vec<str> as WellUnformed>::RequestNormalize = ();
//[next]~^ the type
//[next]~| the type
fn main() {}