mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 10:13:54 +00:00
Clarify more MIR docs
This commit is contained in:
parent
fe40240e4d
commit
26d7b8ddb2
@ -1561,6 +1561,8 @@ impl Statement<'_> {
|
||||
#[derive(Clone, Debug, PartialEq, TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable)]
|
||||
pub enum StatementKind<'tcx> {
|
||||
/// Write the RHS Rvalue to the LHS Place.
|
||||
///
|
||||
/// The LHS place may not overlap with any memory accessed on the RHS.
|
||||
Assign(Box<(Place<'tcx>, Rvalue<'tcx>)>),
|
||||
|
||||
/// This represents all the reading that a pattern match may do
|
||||
@ -1778,6 +1780,19 @@ static_assert_size!(Place<'_>, 16);
|
||||
pub enum ProjectionElem<V, T> {
|
||||
Deref,
|
||||
Field(Field, T),
|
||||
/// Index into a slice/array.
|
||||
///
|
||||
/// Note that this does not also dereference, and so it does not exactly correspond to slice
|
||||
/// indexing in Rust. In other words, in the below Rust code:
|
||||
///
|
||||
/// ```rust
|
||||
/// let x = &[1, 2, 3, 4];
|
||||
/// let i = 2;
|
||||
/// x[i];
|
||||
/// ```
|
||||
///
|
||||
/// The `x[i]` is turned into a `Deref` followed by an `Index`, not just an `Index`. The same
|
||||
/// thing is true of the `ConstantIndex` and `Subslice` projections below.
|
||||
Index(V),
|
||||
|
||||
/// These indices are generated by slice patterns. Easiest to explain
|
||||
|
Loading…
Reference in New Issue
Block a user