about summary refs log tree commit diff
path: root/compiler/rustc_mir
diff options
context:
space:
mode:
authoroli <github35764891676564198441@oli-obk.de>2020-12-30 16:48:07 +0000
committeroli <github35764891676564198441@oli-obk.de>2021-01-01 16:59:12 +0000
commit4158e58d79af7a538944c0acffbc0718551f221a (patch)
treef406daa8bc335f39c3fc1c3da533f8ce998b9725 /compiler/rustc_mir
parent354e510f7d9e9f19b5f3ff55da83658a260bca4f (diff)
downloadrust-4158e58d79af7a538944c0acffbc0718551f221a.tar.gz
rust-4158e58d79af7a538944c0acffbc0718551f221a.zip
Enhance some comments
Diffstat (limited to 'compiler/rustc_mir')
-rw-r--r--compiler/rustc_mir/src/transform/check_consts/validation.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_mir/src/transform/check_consts/validation.rs b/compiler/rustc_mir/src/transform/check_consts/validation.rs
index c2c54c94061..c2b702f265b 100644
--- a/compiler/rustc_mir/src/transform/check_consts/validation.rs
+++ b/compiler/rustc_mir/src/transform/check_consts/validation.rs
@@ -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 {