Skip to content

Commit f318f02

Browse files
committed
Edit rustc_middle docs
Re-word doc comment for rustc_middle::hir::place::Projection. Also adds: - Missing end stop punctuation, and - Documentation links to `rustc_middle::mir::Place`.
1 parent 6340607 commit f318f02

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

compiler/rustc_middle/src/hir/place.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ use rustc_target::abi::VariantIdx;
1717
HashStable
1818
)]
1919
pub enum PlaceBase {
20-
/// A temporary variable
20+
/// A temporary variable.
2121
Rvalue,
22-
/// A named `static` item
22+
/// A named `static` item.
2323
StaticItem,
24-
/// A named local variable
24+
/// A named local variable.
2525
Local(HirId),
26-
/// An upvar referenced by closure env
26+
/// An upvar referenced by closure env.
2727
Upvar(ty::UpvarId),
2828
}
2929

@@ -40,7 +40,7 @@ pub enum PlaceBase {
4040
HashStable
4141
)]
4242
pub enum ProjectionKind {
43-
/// A dereference of a pointer, reference or `Box<T>` of the given type
43+
/// A dereference of a pointer, reference or `Box<T>` of the given type.
4444
Deref,
4545

4646
/// `B.F` where `B` is the base expression and `F` is
@@ -71,16 +71,16 @@ pub enum ProjectionKind {
7171
HashStable
7272
)]
7373
pub struct Projection<'tcx> {
74-
/// Type after the projection is being applied.
74+
/// Type after the projection is applied.
7575
pub ty: Ty<'tcx>,
7676

77-
/// Defines the type of access
77+
/// Defines the kind of access made by the projection.
7878
pub kind: ProjectionKind,
7979
}
8080

8181
/// A `Place` represents how a value is located in memory.
8282
///
83-
/// This is an HIR version of `mir::Place`
83+
/// This is an HIR version of [`rustc_middle::mir::Place`].
8484
#[derive(Clone, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, TypeFoldable, HashStable)]
8585
pub struct Place<'tcx> {
8686
/// The type of the `PlaceBase`
@@ -93,13 +93,13 @@ pub struct Place<'tcx> {
9393

9494
/// A `PlaceWithHirId` represents how a value is located in memory.
9595
///
96-
/// This is an HIR version of `mir::Place`
96+
/// This is an HIR version of [`rustc_middle::mir::Place`].
9797
#[derive(Clone, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, TypeFoldable, HashStable)]
9898
pub struct PlaceWithHirId<'tcx> {
9999
/// `HirId` of the expression or pattern producing this value.
100100
pub hir_id: HirId,
101101

102-
/// Information about the `Place`
102+
/// Information about the `Place`.
103103
pub place: Place<'tcx>,
104104
}
105105

0 commit comments

Comments
 (0)