Skip to content

Commit

Permalink
Rollup merge of rust-lang#94113 - Mizobrook-kan:issue-94025, r=estebank
Browse files Browse the repository at this point in the history
document rustc_middle::mir::Field

cc rust-lang#94025
  • Loading branch information
matthiaskrgr authored Feb 19, 2022
2 parents e5994a5 + 6210208 commit 3641354
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions compiler/rustc_middle/src/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1841,6 +1841,15 @@ static_assert_size!(PlaceElem<'_>, 24);
pub type ProjectionKind = ProjectionElem<(), ()>;

rustc_index::newtype_index! {
/// A [newtype'd][wrapper] index type in the MIR [control-flow graph][CFG]
///
/// A field (e.g., `f` in `_1.f`) is one variant of [`ProjectionElem`]. Conceptually,
/// rustc can identify that a field projection refers to either two different regions of memory
/// or the same one between the base and the 'projection element'.
/// Read more about projections in the [rustc-dev-guide][mir-datatypes]
/// [wrapper]: https://rustc-dev-guide.rust-lang.org/appendix/glossary.html#newtype
/// [CFG]: https://rustc-dev-guide.rust-lang.org/appendix/background.html#cfg
/// [mir-datatypes]: https://rustc-dev-guide.rust-lang.org/mir/index.html#mir-data-types
pub struct Field {
derive [HashStable]
DEBUG_FORMAT = "field[{}]"
Expand Down

0 comments on commit 3641354

Please sign in to comment.