Skip to content

Commit 635b57c

Browse files
enclose else block in terminating scope
1 parent 34f0c45 commit 635b57c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_typeck/src/check/region.rs

+1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ fn resolve_block<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, blk: &'tcx h
144144
// the sequence of visits agree with the order in the default
145145
// `hir::intravisit` visitor.
146146
mem::swap(&mut prev_cx, &mut visitor.cx);
147+
visitor.terminating_scopes.insert(els.hir_id.local_id);
147148
visitor.visit_block(els);
148149
// From now on, we continue normally.
149150
visitor.cx = prev_cx;

src/test/ui/async-await/async-await-let-else.no-drop-tracking.stderr

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ LL | bar2(Rc::new(())).await
3535
| |
3636
| has type `Rc<()>` which is not `Send`
3737
LL | };
38-
LL | }
39-
| - `Rc::new(())` is later dropped here
38+
| - `Rc::new(())` is later dropped here
4039
note: required by a bound in `is_send`
4140
--> $DIR/async-await-let-else.rs:19:15
4241
|

0 commit comments

Comments
 (0)