@@ -1782,6 +1782,13 @@ pub enum StatementKind<'tcx> {
1782
1782
place : Place < ' tcx > ,
1783
1783
} ,
1784
1784
1785
+ /// Escape the given reference to a raw pointer, so that it can be accessed
1786
+ /// without precise provenance tracking. These statements are currently only interpreted
1787
+ /// by miri and only generated when "-Z mir-emit-retag" is passed.
1788
+ /// See <https://internals.rust-lang.org/t/stacked-borrows-an-aliasing-model-for-rust/8153/>
1789
+ /// for more details.
1790
+ EscapeToRaw ( Operand < ' tcx > ) ,
1791
+
1785
1792
/// Mark one terminating point of a region scope (i.e. static region).
1786
1793
/// (The starting point(s) arise implicitly from borrows.)
1787
1794
EndRegion ( region:: Scope ) ,
@@ -1843,6 +1850,7 @@ impl<'tcx> Debug for Statement<'tcx> {
1843
1850
EndRegion ( ref ce) => write ! ( fmt, "EndRegion({})" , ty:: ReScope ( * ce) ) ,
1844
1851
Retag { fn_entry, ref place } =>
1845
1852
write ! ( fmt, "Retag({}{:?})" , if fn_entry { "[fn entry] " } else { "" } , place) ,
1853
+ EscapeToRaw ( ref place) => write ! ( fmt, "EscapeToRaw({:?})" , place) ,
1846
1854
StorageLive ( ref place) => write ! ( fmt, "StorageLive({:?})" , place) ,
1847
1855
StorageDead ( ref place) => write ! ( fmt, "StorageDead({:?})" , place) ,
1848
1856
SetDiscriminant {
@@ -3019,6 +3027,7 @@ EnumTypeFoldableImpl! {
3019
3027
( StatementKind :: StorageDead ) ( a) ,
3020
3028
( StatementKind :: InlineAsm ) { asm, outputs, inputs } ,
3021
3029
( StatementKind :: Retag ) { fn_entry, place } ,
3030
+ ( StatementKind :: EscapeToRaw ) ( place) ,
3022
3031
( StatementKind :: EndRegion ) ( a) ,
3023
3032
( StatementKind :: AscribeUserType ) ( a, v, b) ,
3024
3033
( StatementKind :: Nop ) ,
0 commit comments