diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2023-03-08 14:39:05 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2023-03-09 17:45:13 +0000 |
| commit | 45f2a1af3b9a9a489e78085135e28fc432b68b8a (patch) | |
| tree | 1051bb36670d87cf1485f526b206ec72d8631ab9 | |
| parent | b34a8a294d63aa830e0cb76351390d7df0abb40a (diff) | |
| download | rust-45f2a1af3b9a9a489e78085135e28fc432b68b8a.tar.gz rust-45f2a1af3b9a9a489e78085135e28fc432b68b8a.zip | |
Document borrowck behaviour.
| -rw-r--r-- | compiler/rustc_borrowck/src/def_use.rs | 4 |
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") |
