provide a clearer explanation of scope breaking
This commit is contained in:
parent
e26285603c
commit
8467a7b33e
1 changed files with 3 additions and 1 deletions
|
@ -84,8 +84,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||||
let mut let_scope_stack = Vec::with_capacity(8);
|
let mut let_scope_stack = Vec::with_capacity(8);
|
||||||
let outer_source_scope = this.source_scope;
|
let outer_source_scope = this.source_scope;
|
||||||
let outer_in_scope_unsafe = this.in_scope_unsafe;
|
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.
|
// 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;
|
let mut last_remainder_scope = region_scope;
|
||||||
this.update_source_scope_for_safety_mode(span, safety_mode);
|
this.update_source_scope_for_safety_mode(span, safety_mode);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue