diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-06-11 06:54:38 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-06-11 08:19:19 +0000 |
| commit | 03fa9b807379dbce92b346b489acecff6082e283 (patch) | |
| tree | 44478e1796fbc0c05a6ce64dacc3ded6c6de295a | |
| parent | 6cca6da1265b9bede368f34da6be42057adc9834 (diff) | |
| download | rust-03fa9b807379dbce92b346b489acecff6082e283.tar.gz rust-03fa9b807379dbce92b346b489acecff6082e283.zip | |
Also test under next solver
| -rw-r--r-- | tests/ui/impl-trait/recursive-bound-eval.next.stderr | 9 | ||||
| -rw-r--r-- | tests/ui/impl-trait/recursive-bound-eval.rs | 6 | ||||
| -rw-r--r-- | tests/ui/type-alias-impl-trait/issue-84660-unsoundness.current.stderr (renamed from tests/ui/type-alias-impl-trait/issue-84660-unsoundness.stderr) | 2 | ||||
| -rw-r--r-- | tests/ui/type-alias-impl-trait/issue-84660-unsoundness.next.stderr | 23 | ||||
| -rw-r--r-- | tests/ui/type-alias-impl-trait/issue-84660-unsoundness.rs | 8 | ||||
| -rw-r--r-- | tests/ui/type-alias-impl-trait/nested-tait-inference.current.stderr (renamed from tests/ui/type-alias-impl-trait/nested-tait-inference.stderr) | 2 | ||||
| -rw-r--r-- | tests/ui/type-alias-impl-trait/nested-tait-inference.rs | 13 | ||||
| -rw-r--r-- | tests/ui/type-alias-impl-trait/nested-tait-inference2.current.stderr (renamed from tests/ui/type-alias-impl-trait/nested-tait-inference2.stderr) | 2 | ||||
| -rw-r--r-- | tests/ui/type-alias-impl-trait/nested-tait-inference2.next.stderr | 9 | ||||
| -rw-r--r-- | tests/ui/type-alias-impl-trait/nested-tait-inference2.rs | 7 |
10 files changed, 71 insertions, 10 deletions
diff --git a/tests/ui/impl-trait/recursive-bound-eval.next.stderr b/tests/ui/impl-trait/recursive-bound-eval.next.stderr new file mode 100644 index 00000000000..4bab290d71c --- /dev/null +++ b/tests/ui/impl-trait/recursive-bound-eval.next.stderr @@ -0,0 +1,9 @@ +error[E0282]: type annotations needed + --> $DIR/recursive-bound-eval.rs:20:13 + | +LL | move || recursive_fn().parse() + | ^^^^^^^^^^^^^^ cannot infer type + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/tests/ui/impl-trait/recursive-bound-eval.rs b/tests/ui/impl-trait/recursive-bound-eval.rs index 591553e7ceb..7859c8983fc 100644 --- a/tests/ui/impl-trait/recursive-bound-eval.rs +++ b/tests/ui/impl-trait/recursive-bound-eval.rs @@ -1,7 +1,10 @@ //! Test that we can evaluate nested obligations when invoking methods on recursive calls on //! an RPIT. -//@ check-pass +//@revisions: next current +//@[next] compile-flags: -Znext-solver + +//@[current] check-pass pub trait Parser<E> { fn parse(&self) -> E; @@ -15,6 +18,7 @@ impl<E, T: Fn() -> E> Parser<E> for T { pub fn recursive_fn<E>() -> impl Parser<E> { move || recursive_fn().parse() + //[next]~^ ERROR: type annotations needed } fn main() {} diff --git a/tests/ui/type-alias-impl-trait/issue-84660-unsoundness.stderr b/tests/ui/type-alias-impl-trait/issue-84660-unsoundness.current.stderr index 461da20f37b..a7ff097e8bf 100644 --- a/tests/ui/type-alias-impl-trait/issue-84660-unsoundness.stderr +++ b/tests/ui/type-alias-impl-trait/issue-84660-unsoundness.current.stderr @@ -1,5 +1,5 @@ error[E0119]: conflicting implementations of trait `Trait<Bar, _>` - --> $DIR/issue-84660-unsoundness.rs:23:1 + --> $DIR/issue-84660-unsoundness.rs:28:1 | LL | impl<In, Out> Trait<Bar, In> for Out { | ------------------------------------ first implementation here diff --git a/tests/ui/type-alias-impl-trait/issue-84660-unsoundness.next.stderr b/tests/ui/type-alias-impl-trait/issue-84660-unsoundness.next.stderr new file mode 100644 index 00000000000..607f0b062ab --- /dev/null +++ b/tests/ui/type-alias-impl-trait/issue-84660-unsoundness.next.stderr @@ -0,0 +1,23 @@ +error[E0284]: type annotations needed: cannot satisfy `<Out as Trait<Bar, In>>::Out == ()` + --> $DIR/issue-84660-unsoundness.rs:22:37 + | +LL | fn convert(_i: In) -> Self::Out { + | _____________________________________^ +LL | | +LL | | unreachable!(); +LL | | } + | |_____^ cannot satisfy `<Out as Trait<Bar, In>>::Out == ()` + +error[E0119]: conflicting implementations of trait `Trait<Bar, _>` + --> $DIR/issue-84660-unsoundness.rs:28:1 + | +LL | impl<In, Out> Trait<Bar, In> for Out { + | ------------------------------------ first implementation here +... +LL | impl<In, Out> Trait<(), In> for Out { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0119, E0284. +For more information about an error, try `rustc --explain E0119`. diff --git a/tests/ui/type-alias-impl-trait/issue-84660-unsoundness.rs b/tests/ui/type-alias-impl-trait/issue-84660-unsoundness.rs index 48d4b0c96ff..fd1f3c6353c 100644 --- a/tests/ui/type-alias-impl-trait/issue-84660-unsoundness.rs +++ b/tests/ui/type-alias-impl-trait/issue-84660-unsoundness.rs @@ -1,6 +1,10 @@ // Another example from issue #84660, this time weaponized as a safe transmute: an opaque type in an // impl header being accepted was used to create unsoundness. +//@ revisions: current next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver + #![feature(type_alias_impl_trait)] trait Foo {} @@ -16,11 +20,13 @@ trait Trait<T, In> { impl<In, Out> Trait<Bar, In> for Out { type Out = Out; fn convert(_i: In) -> Self::Out { + //[next]~^ ERROR: cannot satisfy `<Out as Trait<Bar, In>>::Out == ()` unreachable!(); } } -impl<In, Out> Trait<(), In> for Out { //~ ERROR conflicting implementations of trait `Trait<Bar, _>` +impl<In, Out> Trait<(), In> for Out { + //~^ ERROR conflicting implementations of trait `Trait<Bar, _>` type Out = In; fn convert(i: In) -> Self::Out { i diff --git a/tests/ui/type-alias-impl-trait/nested-tait-inference.stderr b/tests/ui/type-alias-impl-trait/nested-tait-inference.current.stderr index 172ecded7a2..34532afcbba 100644 --- a/tests/ui/type-alias-impl-trait/nested-tait-inference.stderr +++ b/tests/ui/type-alias-impl-trait/nested-tait-inference.current.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `(): Foo<FooX>` is not satisfied - --> $DIR/nested-tait-inference.rs:12:13 + --> $DIR/nested-tait-inference.rs:17:13 | LL | fn foo() -> impl Foo<FooX> { | ^^^^^^^^^^^^^^ the trait `Foo<FooX>` is not implemented for `()` diff --git a/tests/ui/type-alias-impl-trait/nested-tait-inference.rs b/tests/ui/type-alias-impl-trait/nested-tait-inference.rs index 82248971692..50d51c7faf9 100644 --- a/tests/ui/type-alias-impl-trait/nested-tait-inference.rs +++ b/tests/ui/type-alias-impl-trait/nested-tait-inference.rs @@ -1,18 +1,23 @@ #![feature(type_alias_impl_trait)] #![allow(dead_code)] +//@ revisions: current next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[next] check-pass + use std::fmt::Debug; type FooX = impl Debug; -trait Foo<A> { } +trait Foo<A> {} -impl Foo<()> for () { } +impl Foo<()> for () {} fn foo() -> impl Foo<FooX> { - //~^ ERROR: the trait bound `(): Foo<FooX>` is not satisfied + //[current]~^ ERROR: the trait bound `(): Foo<FooX>` is not satisfied // FIXME(type-alias-impl-trait): We could probably make this work. () } -fn main() { } +fn main() {} diff --git a/tests/ui/type-alias-impl-trait/nested-tait-inference2.stderr b/tests/ui/type-alias-impl-trait/nested-tait-inference2.current.stderr index 241342b0509..614bc09872f 100644 --- a/tests/ui/type-alias-impl-trait/nested-tait-inference2.stderr +++ b/tests/ui/type-alias-impl-trait/nested-tait-inference2.current.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `(): Foo<FooX>` is not satisfied - --> $DIR/nested-tait-inference2.rs:13:13 + --> $DIR/nested-tait-inference2.rs:17:13 | LL | fn foo() -> impl Foo<FooX> { | ^^^^^^^^^^^^^^ the trait `Foo<FooX>` is not implemented for `()` diff --git a/tests/ui/type-alias-impl-trait/nested-tait-inference2.next.stderr b/tests/ui/type-alias-impl-trait/nested-tait-inference2.next.stderr new file mode 100644 index 00000000000..9647d9e376e --- /dev/null +++ b/tests/ui/type-alias-impl-trait/nested-tait-inference2.next.stderr @@ -0,0 +1,9 @@ +error[E0284]: type annotations needed: cannot satisfy `impl Foo<FooX> == ()` + --> $DIR/nested-tait-inference2.rs:19:5 + | +LL | () + | ^^ cannot satisfy `impl Foo<FooX> == ()` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0284`. diff --git a/tests/ui/type-alias-impl-trait/nested-tait-inference2.rs b/tests/ui/type-alias-impl-trait/nested-tait-inference2.rs index 0d7f5bad25f..28d72b0cbee 100644 --- a/tests/ui/type-alias-impl-trait/nested-tait-inference2.rs +++ b/tests/ui/type-alias-impl-trait/nested-tait-inference2.rs @@ -1,6 +1,10 @@ #![feature(type_alias_impl_trait)] #![allow(dead_code)] +//@ revisions: current next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver + use std::fmt::Debug; type FooX = impl Debug; @@ -11,8 +15,9 @@ impl Foo<()> for () {} impl Foo<u32> for () {} fn foo() -> impl Foo<FooX> { - //~^ ERROR: the trait bound `(): Foo<FooX>` is not satisfied + //[current]~^ ERROR: the trait bound `(): Foo<FooX>` is not satisfied () + //[next]~^ ERROR: cannot satisfy `impl Foo<FooX> == ()` } fn main() {} |
