Skip to content

Commit c2e6329

Browse files
committed
doc(hir::Place): clarify that places aren't always place expressions
1 parent 1524060 commit c2e6329

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

compiler/rustc_middle/src/hir/place.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ pub struct Projection<'tcx> {
5353
pub kind: ProjectionKind,
5454
}
5555

56-
/// A `Place` represents how a value is located in memory.
56+
/// A `Place` represents how a value is located in memory. This does not
57+
/// always correspond to a syntactic place expression. For example, when
58+
/// processing a pattern, a `Place` can be used to refer to the sub-value
59+
/// currently being inspected.
5760
///
5861
/// This is an HIR version of [`rustc_middle::mir::Place`].
5962
#[derive(Clone, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]
@@ -67,7 +70,10 @@ pub struct Place<'tcx> {
6770
pub projections: Vec<Projection<'tcx>>,
6871
}
6972

70-
/// A `PlaceWithHirId` represents how a value is located in memory.
73+
/// A `PlaceWithHirId` represents how a value is located in memory. This does not
74+
/// always correspond to a syntactic place expression. For example, when
75+
/// processing a pattern, a `Place` can be used to refer to the sub-value
76+
/// currently being inspected.
7177
///
7278
/// This is an HIR version of [`rustc_middle::mir::Place`].
7379
#[derive(Clone, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]

0 commit comments

Comments
 (0)