From c86974d94f918578b3a2a0b6b858e97be611c0f7 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Wed, 28 Feb 2024 09:54:44 +0000 Subject: [PATCH] test that fudging with opaque types is the same in the new solver --- ...=> hidden-type-is-opaque-2.default.stderr} | 4 +-- .../hidden-type-is-opaque-2.next.stderr | 31 +++++++++++++++++++ .../ui/impl-trait/hidden-type-is-opaque-2.rs | 2 ++ 3 files changed, 35 insertions(+), 2 deletions(-) rename tests/ui/impl-trait/{hidden-type-is-opaque-2.stderr => hidden-type-is-opaque-2.default.stderr} (90%) create mode 100644 tests/ui/impl-trait/hidden-type-is-opaque-2.next.stderr diff --git a/tests/ui/impl-trait/hidden-type-is-opaque-2.stderr b/tests/ui/impl-trait/hidden-type-is-opaque-2.default.stderr similarity index 90% rename from tests/ui/impl-trait/hidden-type-is-opaque-2.stderr rename to tests/ui/impl-trait/hidden-type-is-opaque-2.default.stderr index 39bf2214232..01c5a553dc5 100644 --- a/tests/ui/impl-trait/hidden-type-is-opaque-2.stderr +++ b/tests/ui/impl-trait/hidden-type-is-opaque-2.default.stderr @@ -1,5 +1,5 @@ error[E0282]: type annotations needed - --> $DIR/hidden-type-is-opaque-2.rs:8:17 + --> $DIR/hidden-type-is-opaque-2.rs:10:17 | LL | Thunk::new(|mut cont| { | ^^^^^^^^ @@ -13,7 +13,7 @@ LL | Thunk::new(|mut cont: /* Type */| { | ++++++++++++ error[E0282]: type annotations needed - --> $DIR/hidden-type-is-opaque-2.rs:18:17 + --> $DIR/hidden-type-is-opaque-2.rs:20:17 | LL | Thunk::new(|mut cont| { | ^^^^^^^^ diff --git a/tests/ui/impl-trait/hidden-type-is-opaque-2.next.stderr b/tests/ui/impl-trait/hidden-type-is-opaque-2.next.stderr new file mode 100644 index 00000000000..01c5a553dc5 --- /dev/null +++ b/tests/ui/impl-trait/hidden-type-is-opaque-2.next.stderr @@ -0,0 +1,31 @@ +error[E0282]: type annotations needed + --> $DIR/hidden-type-is-opaque-2.rs:10:17 + | +LL | Thunk::new(|mut cont| { + | ^^^^^^^^ +LL | +LL | cont.reify_as(); + | ---- type must be known at this point + | +help: consider giving this closure parameter an explicit type + | +LL | Thunk::new(|mut cont: /* Type */| { + | ++++++++++++ + +error[E0282]: type annotations needed + --> $DIR/hidden-type-is-opaque-2.rs:20:17 + | +LL | Thunk::new(|mut cont| { + | ^^^^^^^^ +LL | +LL | cont.reify_as(); + | ---- type must be known at this point + | +help: consider giving this closure parameter an explicit type + | +LL | Thunk::new(|mut cont: /* Type */| { + | ++++++++++++ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0282`. diff --git a/tests/ui/impl-trait/hidden-type-is-opaque-2.rs b/tests/ui/impl-trait/hidden-type-is-opaque-2.rs index 212e7b10802..78ac8363ba9 100644 --- a/tests/ui/impl-trait/hidden-type-is-opaque-2.rs +++ b/tests/ui/impl-trait/hidden-type-is-opaque-2.rs @@ -1,6 +1,8 @@ // This doesn't work, because we don't flow information from opaque types // into function arguments via the function's generic parameters // FIXME(oli-obk): make `expected_inputs_for_expected_output` support this +//@ revisions: default next +//@[next] compile-flags: -Znext-solver #![feature(type_alias_impl_trait)]