diff --git a/compiler/rustc_typeck/src/check/region.rs b/compiler/rustc_typeck/src/check/region.rs index 46ffafc5a619a..b89db79bef8d9 100644 --- a/compiler/rustc_typeck/src/check/region.rs +++ b/compiler/rustc_typeck/src/check/region.rs @@ -144,6 +144,7 @@ fn resolve_block<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, blk: &'tcx h // the sequence of visits agree with the order in the default // `hir::intravisit` visitor. mem::swap(&mut prev_cx, &mut visitor.cx); + visitor.terminating_scopes.insert(els.hir_id.local_id); visitor.visit_block(els); // From now on, we continue normally. visitor.cx = prev_cx; diff --git a/src/test/ui/async-await/async-await-let-else.stderr b/src/test/ui/async-await/async-await-let-else.stderr index aef3c03a961f9..791091abe353b 100644 --- a/src/test/ui/async-await/async-await-let-else.stderr +++ b/src/test/ui/async-await/async-await-let-else.stderr @@ -35,8 +35,7 @@ LL | bar2(Rc::new(())).await | | | has type `Rc<()>` which is not `Send` LL | }; -LL | } - | - `Rc::new(())` is later dropped here + | - `Rc::new(())` is later dropped here note: required by a bound in `is_send` --> $DIR/async-await-let-else.rs:16:15 |