Skip to content

Commit 6f3bde9

Browse files
committed
Remove unnecessary generator-check, which also fixes the issue within async functions
1 parent 97afa07 commit 6f3bde9

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

compiler/rustc_mir_transform/src/reveal_all.rs

-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ pub struct RevealAll;
99

1010
impl<'tcx> MirPass<'tcx> for RevealAll {
1111
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
12-
// Do not apply this transformation to generators.
13-
if body.generator.is_some() {
14-
return;
15-
}
16-
1712
let param_env = tcx.param_env_reveal_all_normalized(body.source.def_id());
1813
RevealAllVisitor { tcx, param_env }.visit_body_preserves_cfg(body);
1914
}

tests/ui/type-alias-impl-trait/destructure_tait-ice-113594.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// build-pass
2+
// edition: 2021
23

34
#![feature(type_alias_impl_trait)]
45

@@ -9,7 +10,7 @@ pub struct Foo {
910

1011
pub type Tait = impl Sized;
1112

12-
pub fn ice_cold(beverage: Tait) {
13+
pub async fn ice_cold(beverage: Tait) {
1314
// Must destructure at least one field of `Foo`
1415
let Foo { field } = beverage;
1516
_ = field;

0 commit comments

Comments
 (0)