Add new Deinit
statement kind
This commit is contained in:
parent
d00e77078c
commit
9b6b1a625b
27 changed files with 141 additions and 66 deletions
|
@ -131,7 +131,8 @@ impl<'mir, 'tcx> crate::GenKillAnalysis<'tcx> for MaybeRequiresStorage<'mir, 'tc
|
|||
|
||||
// If a place is assigned to in a statement, it needs storage for that statement.
|
||||
StatementKind::Assign(box (place, _))
|
||||
| StatementKind::SetDiscriminant { box place, .. } => {
|
||||
| StatementKind::SetDiscriminant { box place, .. }
|
||||
| StatementKind::Deinit(box place) => {
|
||||
trans.gen(place.local);
|
||||
}
|
||||
|
||||
|
|
|
@ -296,10 +296,10 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
|
|||
StatementKind::StorageDead(local) => {
|
||||
self.gather_move(Place::from(*local));
|
||||
}
|
||||
StatementKind::SetDiscriminant { .. } => {
|
||||
StatementKind::SetDiscriminant { .. } | StatementKind::Deinit(..) => {
|
||||
span_bug!(
|
||||
stmt.source_info.span,
|
||||
"SetDiscriminant should not exist during borrowck"
|
||||
"SetDiscriminant/Deinit should not exist during borrowck"
|
||||
);
|
||||
}
|
||||
StatementKind::Retag { .. }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue