about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaja Kądziołka <maya@compilercrim.es>2025-02-26 03:08:03 +0100
committerMaja Kądziołka <maya@compilercrim.es>2025-03-26 16:32:57 +0100
commita86e0dacbce4e9bc624ef1ebd71a575c9dd0aa01 (patch)
treeb6c3b9ce9b349ad34aac2daa6d5baee6f3c21e1e
parentf1bc669636023c8643602431791c7f26e5a6edef (diff)
downloadrust-a86e0dacbce4e9bc624ef1ebd71a575c9dd0aa01.tar.gz
rust-a86e0dacbce4e9bc624ef1ebd71a575c9dd0aa01.zip
doc(hir::Place): clarify that places aren't always place expressions
-rw-r--r--compiler/rustc_middle/src/hir/place.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/hir/place.rs b/compiler/rustc_middle/src/hir/place.rs
index 316ad80eb98..60ce8544aa0 100644
--- a/compiler/rustc_middle/src/hir/place.rs
+++ b/compiler/rustc_middle/src/hir/place.rs
@@ -53,7 +53,10 @@ pub struct Projection<'tcx> {
     pub kind: ProjectionKind,
 }
 
-/// A `Place` represents how a value is located in memory.
+/// A `Place` represents how a value is located in memory. This does not
+/// always correspond to a syntactic place expression. For example, when
+/// processing a pattern, a `Place` can be used to refer to the sub-value
+/// currently being inspected.
 ///
 /// This is an HIR version of [`rustc_middle::mir::Place`].
 #[derive(Clone, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]
@@ -67,7 +70,10 @@ pub struct Place<'tcx> {
     pub projections: Vec<Projection<'tcx>>,
 }
 
-/// A `PlaceWithHirId` represents how a value is located in memory.
+/// A `PlaceWithHirId` represents how a value is located in memory. This does not
+/// always correspond to a syntactic place expression. For example, when
+/// processing a pattern, a `Place` can be used to refer to the sub-value
+/// currently being inspected.
 ///
 /// This is an HIR version of [`rustc_middle::mir::Place`].
 #[derive(Clone, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]