Skip to content

Commit

Permalink
Remove unnecessary generator-check, which also fixes the issue within…
Browse files Browse the repository at this point in the history
… async functions
  • Loading branch information
oli-obk committed Sep 11, 2023
1 parent 97afa07 commit 6f3bde9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 0 additions & 5 deletions compiler/rustc_mir_transform/src/reveal_all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// build-pass
// edition: 2021

#![feature(type_alias_impl_trait)]

Expand All @@ -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;
Expand Down

0 comments on commit 6f3bde9

Please sign in to comment.