Skip to content

Commit 8467a7b

Browse files
provide a clearer explanation of scope breaking
1 parent e262856 commit 8467a7b

File tree

1 file changed

+3
-1
lines changed
  • compiler/rustc_mir_build/src/build

1 file changed

+3
-1
lines changed

compiler/rustc_mir_build/src/build/block.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
8484
let mut let_scope_stack = Vec::with_capacity(8);
8585
let outer_source_scope = this.source_scope;
8686
let outer_in_scope_unsafe = this.in_scope_unsafe;
87-
// This scope information is kept for breaking out of the current block in case
87+
// This scope information is kept for breaking out of the parent remainder scope in case
8888
// one let-else pattern matching fails.
89+
// By doing so, we can be sure that even temporaries that receive extended lifetime
90+
// assignments are dropped, too.
8991
let mut last_remainder_scope = region_scope;
9092
this.update_source_scope_for_safety_mode(span, safety_mode);
9193

0 commit comments

Comments
 (0)