Skip to content

Commit 3641354

Browse files
authored
Rollup merge of rust-lang#94113 - Mizobrook-kan:issue-94025, r=estebank
document rustc_middle::mir::Field cc rust-lang#94025
2 parents e5994a5 + 6210208 commit 3641354

File tree

1 file changed

+9
-0
lines changed
  • compiler/rustc_middle/src/mir

1 file changed

+9
-0
lines changed

compiler/rustc_middle/src/mir/mod.rs

+9
Original file line numberDiff line numberDiff line change
@@ -1841,6 +1841,15 @@ static_assert_size!(PlaceElem<'_>, 24);
18411841
pub type ProjectionKind = ProjectionElem<(), ()>;
18421842

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

0 commit comments

Comments
 (0)