It's fine to assign otherwise_block
s to unreachable candidates
This commit is contained in:
parent
105bdf7086
commit
b4f0e76021
1 changed files with 4 additions and 11 deletions
|
@ -1314,24 +1314,17 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut next_prebinding = start_block;
|
let mut next_prebinding = start_block;
|
||||||
let mut reachable = true;
|
|
||||||
|
|
||||||
for candidate in matched_candidates.iter_mut() {
|
for candidate in matched_candidates.iter_mut() {
|
||||||
assert!(candidate.otherwise_block.is_none());
|
assert!(candidate.otherwise_block.is_none());
|
||||||
assert!(candidate.pre_binding_block.is_none());
|
assert!(candidate.pre_binding_block.is_none());
|
||||||
candidate.pre_binding_block = Some(next_prebinding);
|
candidate.pre_binding_block = Some(next_prebinding);
|
||||||
next_prebinding = self.cfg.start_new_block();
|
next_prebinding = self.cfg.start_new_block();
|
||||||
if reachable {
|
if candidate.has_guard {
|
||||||
if candidate.has_guard {
|
// Create the otherwise block for this candidate, which is the
|
||||||
// Create the otherwise block for this candidate, which is the
|
// pre-binding block for the next candidate.
|
||||||
// pre-binding block for the next candidate.
|
candidate.otherwise_block = Some(next_prebinding);
|
||||||
candidate.otherwise_block = Some(next_prebinding);
|
|
||||||
} else {
|
|
||||||
reachable = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
next_prebinding
|
next_prebinding
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue