File tree 2 files changed +15
-6
lines changed
2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -1755,12 +1755,16 @@ pub enum StatementKind<'tcx> {
1755
1755
} ,
1756
1756
1757
1757
/// Retag references in the given place, ensuring they got fresh tags. This is
1758
- /// part of the Stacked Borrows model. `fn_entry` indicates whether this
1759
- /// is the initial retag that happens in the function prolog. These statements are
1760
- /// currently only interpreted by miri and only generated when "-Z mir-emit-retag" is passed.
1758
+ /// part of the Stacked Borrows model. These statements are currently only interpreted
1759
+ /// by miri and only generated when "-Z mir-emit-retag" is passed.
1761
1760
/// See <https://internals.rust-lang.org/t/stacked-borrows-an-aliasing-model-for-rust/8153/>
1762
1761
/// for more details.
1763
- Retag { fn_entry : bool , place : Place < ' tcx > } ,
1762
+ Retag {
1763
+ /// `fn_entry` indicates whether this is the initial retag that happens in the
1764
+ /// function prolog.
1765
+ fn_entry : bool ,
1766
+ place : Place < ' tcx > ,
1767
+ } ,
1764
1768
1765
1769
/// Mark one terminating point of a region scope (i.e. static region).
1766
1770
/// (The starting point(s) arise implicitly from borrows.)
Original file line number Diff line number Diff line change @@ -42,7 +42,12 @@ fn is_local<'tcx>(
42
42
// (a local storing the array index, the current value of
43
43
// the projection base), so we stop tracking here.
44
44
false ,
45
- _ => is_local ( & proj. base ) ,
45
+ ProjectionElem :: Field { .. } |
46
+ ProjectionElem :: ConstantIndex { .. } |
47
+ ProjectionElem :: Subslice { .. } |
48
+ ProjectionElem :: Downcast { .. } =>
49
+ // These just offset by a constant, entirely independent of everything else.
50
+ is_local ( & proj. base ) ,
46
51
}
47
52
}
48
53
}
@@ -121,7 +126,7 @@ impl MirPass for AddRetag {
121
126
Some ( Terminator { kind : TerminatorKind :: Call { ref destination, .. } ,
122
127
source_info } ) => {
123
128
// Remember the return destination for later
124
- if let & Some ( ref destination) = destination {
129
+ if let Some ( ref destination) = destination {
125
130
if needs_retag ( & destination. 0 ) {
126
131
returns. push ( ( source_info, destination. 0 . clone ( ) , destination. 1 ) ) ;
127
132
}
You can’t perform that action at this time.
0 commit comments