},
/// Retag references in the given place, ensuring they got fresh tags. This is
- /// part of the Stacked Borrows model. `fn_entry` indicates whether this
- /// is the initial retag that happens in the function prolog. These statements are
- /// currently only interpreted by miri and only generated when "-Z mir-emit-retag" is passed.
+ /// part of the Stacked Borrows model. These statements are currently only interpreted
+ /// by miri and only generated when "-Z mir-emit-retag" is passed.
/// See <https://internals.rust-lang.org/t/stacked-borrows-an-aliasing-model-for-rust/8153/>
/// for more details.
- Retag { fn_entry: bool, place: Place<'tcx> },
+ Retag {
+ /// `fn_entry` indicates whether this is the initial retag that happens in the
+ /// function prolog.
+ fn_entry: bool,
+ place: Place<'tcx>,
+ },
/// Mark one terminating point of a region scope (i.e. static region).
/// (The starting point(s) arise implicitly from borrows.)
// (a local storing the array index, the current value of
// the projection base), so we stop tracking here.
false,
- _ => is_local(&proj.base),
+ ProjectionElem::Field { .. } |
+ ProjectionElem::ConstantIndex { .. } |
+ ProjectionElem::Subslice { .. } |
+ ProjectionElem::Downcast { .. } =>
+ // These just offset by a constant, entirely independent of everything else.
+ is_local(&proj.base),
}
}
}
Some(Terminator { kind: TerminatorKind::Call { ref destination, .. },
source_info }) => {
// Remember the return destination for later
- if let &Some(ref destination) = destination {
+ if let Some(ref destination) = destination {
if needs_retag(&destination.0) {
returns.push((source_info, destination.0.clone(), destination.1));
}