Skip to content

Commit af69542

Browse files
committed
MERGEME fix impl TypeFoldable for Statement post rebase to account for EndRegion.
1 parent 2e95286 commit af69542

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/librustc/mir/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,6 +1429,13 @@ impl<'tcx> TypeFoldable<'tcx> for Statement<'tcx> {
14291429
outputs: outputs.fold_with(folder),
14301430
inputs: inputs.fold_with(folder)
14311431
},
1432+
1433+
// Note for future: If we want to expose the extents
1434+
// during the fold, we need to either generalize EndRegion
1435+
// to carry `[ty::Region]`, or extend the `TypeFolder`
1436+
// trait with a `fn fold_extent`.
1437+
EndRegion(ref extents) => EndRegion(extents.clone()),
1438+
14321439
Nop => Nop,
14331440
};
14341441
Statement {
@@ -1447,6 +1454,13 @@ impl<'tcx> TypeFoldable<'tcx> for Statement<'tcx> {
14471454
StorageDead(ref lvalue) => lvalue.visit_with(visitor),
14481455
InlineAsm { ref outputs, ref inputs, .. } =>
14491456
outputs.visit_with(visitor) || inputs.visit_with(visitor),
1457+
1458+
// Note for future: If we want to expose the extents
1459+
// during the visit, we need to either generalize EndRegion
1460+
// to carry `[ty::Region]`, or extend the `TypeVisitor`
1461+
// trait with a `fn visit_extent`.
1462+
EndRegion(ref _extents) => false,
1463+
14501464
Nop => false,
14511465
}
14521466
}

0 commit comments

Comments
 (0)