Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit rustc_middle docs #80166

Merged
merged 1 commit into from
Dec 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions compiler/rustc_middle/src/hir/place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ use rustc_target::abi::VariantIdx;
HashStable
)]
pub enum PlaceBase {
/// A temporary variable
/// A temporary variable.
Rvalue,
/// A named `static` item
/// A named `static` item.
StaticItem,
/// A named local variable
/// A named local variable.
Local(HirId),
/// An upvar referenced by closure env
/// An upvar referenced by closure env.
Upvar(ty::UpvarId),
}

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

/// `B.F` where `B` is the base expression and `F` is
Expand Down Expand Up @@ -71,16 +71,16 @@ pub enum ProjectionKind {
HashStable
)]
pub struct Projection<'tcx> {
/// Type after the projection is being applied.
/// Type after the projection is applied.
pub ty: Ty<'tcx>,

/// Defines the type of access
/// Defines the kind of access made by the projection.
petrochenkov marked this conversation as resolved.
Show resolved Hide resolved
pub kind: ProjectionKind,
}

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

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

/// Information about the `Place`
/// Information about the `Place`.
pub place: Place<'tcx>,
}

Expand Down