1
Fork 0

supplement for the missing or incomplete comments

This commit is contained in:
Ding Xiang Fei 2022-09-05 14:24:13 +08:00
parent af591ebe4d
commit 34f0c4502f
No known key found for this signature in database
GPG key ID: 3CD748647EEF6359
2 changed files with 13 additions and 2 deletions

View file

@ -119,10 +119,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
} => {
let ignores_expr_result = matches!(pattern.kind, PatKind::Wild);
this.block_context.push(BlockFrame::Statement { ignores_expr_result });
// Lower the `else` block first because its parent scope is actually
// enclosing the rest of the `let .. else ..` parts.
let else_block_span = this.thir[*else_block].span;
// This place is not really used because this destination place
// should never be used to take values at the end of the failure
// block.
let else_block_span = this.thir[*else_block].span;
let dummy_place = this.temp(this.tcx.types.never, else_block_span);
let failure_entry = this.cfg.start_new_block();
let failure_block;