doc(hir::Place): clarify that places aren't always place expressions

This commit is contained in:
Maja Kądziołka 2025-02-26 03:08:03 +01:00
parent f1bc669636
commit a86e0dacbc
No known key found for this signature in database

View file

@ -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)]