Enhance some comments

This commit is contained in:
oli 2020-12-30 16:48:07 +00:00
parent 354e510f7d
commit 4158e58d79
3 changed files with 16 additions and 9 deletions

View file

@ -584,6 +584,8 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
if borrowed_place_has_mut_interior {
// Locals without StorageDead follow the "enclosing scope" rule, meaning
// they are essentially anonymous static items themselves.
// Note: This is only sound if every local that has a `StorageDead` has a
// `StorageDead` in every control flow path leading to a `return` terminator.
if self.local_has_storage_dead(place.local) {
self.check_op(ops::CellBorrowBehindRef);
} else {