From 6f3bde9d8d89030ed5fd1edc5f3a5ec63f245c95 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Mon, 11 Sep 2023 17:41:10 +0000 Subject: [PATCH] Remove unnecessary generator-check, which also fixes the issue within async functions --- compiler/rustc_mir_transform/src/reveal_all.rs | 5 ----- .../ui/type-alias-impl-trait/destructure_tait-ice-113594.rs | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_mir_transform/src/reveal_all.rs b/compiler/rustc_mir_transform/src/reveal_all.rs index b4ae9041bc1f1..68f67d57df09b 100644 --- a/compiler/rustc_mir_transform/src/reveal_all.rs +++ b/compiler/rustc_mir_transform/src/reveal_all.rs @@ -9,11 +9,6 @@ pub struct RevealAll; impl<'tcx> MirPass<'tcx> for RevealAll { fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { - // Do not apply this transformation to generators. - if body.generator.is_some() { - return; - } - let param_env = tcx.param_env_reveal_all_normalized(body.source.def_id()); RevealAllVisitor { tcx, param_env }.visit_body_preserves_cfg(body); } diff --git a/tests/ui/type-alias-impl-trait/destructure_tait-ice-113594.rs b/tests/ui/type-alias-impl-trait/destructure_tait-ice-113594.rs index 67825e0568c74..7c2d68cceb8fc 100644 --- a/tests/ui/type-alias-impl-trait/destructure_tait-ice-113594.rs +++ b/tests/ui/type-alias-impl-trait/destructure_tait-ice-113594.rs @@ -1,4 +1,5 @@ // build-pass +// edition: 2021 #![feature(type_alias_impl_trait)] @@ -9,7 +10,7 @@ pub struct Foo { pub type Tait = impl Sized; -pub fn ice_cold(beverage: Tait) { +pub async fn ice_cold(beverage: Tait) { // Must destructure at least one field of `Foo` let Foo { field } = beverage; _ = field;