about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-03-08 14:39:05 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-03-09 17:45:13 +0000
commit45f2a1af3b9a9a489e78085135e28fc432b68b8a (patch)
tree1051bb36670d87cf1485f526b206ec72d8631ab9
parentb34a8a294d63aa830e0cb76351390d7df0abb40a (diff)
downloadrust-45f2a1af3b9a9a489e78085135e28fc432b68b8a.tar.gz
rust-45f2a1af3b9a9a489e78085135e28fc432b68b8a.zip
Document borrowck behaviour.
-rw-r--r--compiler/rustc_borrowck/src/def_use.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_borrowck/src/def_use.rs b/compiler/rustc_borrowck/src/def_use.rs
index c67411c4784..9e9f0b4b4ad 100644
--- a/compiler/rustc_borrowck/src/def_use.rs
+++ b/compiler/rustc_borrowck/src/def_use.rs
@@ -72,8 +72,10 @@ pub fn categorize(context: PlaceContext) -> Option<DefUse> {
         PlaceContext::MutatingUse(MutatingUseContext::Drop) =>
             Some(DefUse::Drop),
 
+        // This statement exists to help unsafeck. It does not require the place to be live.
+        PlaceContext::NonUse(NonUseContext::PlaceMention) => None,
         // Debug info is neither def nor use.
-        PlaceContext::NonUse(NonUseContext::PlaceMention | NonUseContext::VarDebugInfo) => None,
+        PlaceContext::NonUse(NonUseContext::VarDebugInfo) => None,
 
         PlaceContext::MutatingUse(MutatingUseContext::Deinit | MutatingUseContext::SetDiscriminant) => {
             bug!("These statements are not allowed in this MIR phase")