Skip to content

Commit

Permalink
provide a clearer explanation of scope breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
dingxiangfei2009 committed Jul 31, 2022
1 parent e262856 commit 8467a7b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_mir_build/src/build/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
let mut let_scope_stack = Vec::with_capacity(8);
let outer_source_scope = this.source_scope;
let outer_in_scope_unsafe = this.in_scope_unsafe;
// This scope information is kept for breaking out of the current block in case
// This scope information is kept for breaking out of the parent remainder scope in case
// one let-else pattern matching fails.
// By doing so, we can be sure that even temporaries that receive extended lifetime
// assignments are dropped, too.
let mut last_remainder_scope = region_scope;
this.update_source_scope_for_safety_mode(span, safety_mode);

Expand Down

0 comments on commit 8467a7b

Please sign in to comment.