@@ -1782,6 +1782,13 @@ pub enum StatementKind<'tcx> {
17821782 place : Place < ' tcx > ,
17831783 } ,
17841784
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+
17851792 /// Mark one terminating point of a region scope (i.e. static region).
17861793 /// (The starting point(s) arise implicitly from borrows.)
17871794 EndRegion ( region:: Scope ) ,
@@ -1843,6 +1850,7 @@ impl<'tcx> Debug for Statement<'tcx> {
18431850 EndRegion ( ref ce) => write ! ( fmt, "EndRegion({})" , ty:: ReScope ( * ce) ) ,
18441851 Retag { fn_entry, ref place } =>
18451852 write ! ( fmt, "Retag({}{:?})" , if fn_entry { "[fn entry] " } else { "" } , place) ,
1853+ EscapeToRaw ( ref place) => write ! ( fmt, "EscapeToRaw({:?})" , place) ,
18461854 StorageLive ( ref place) => write ! ( fmt, "StorageLive({:?})" , place) ,
18471855 StorageDead ( ref place) => write ! ( fmt, "StorageDead({:?})" , place) ,
18481856 SetDiscriminant {
@@ -3019,6 +3027,7 @@ EnumTypeFoldableImpl! {
30193027 ( StatementKind :: StorageDead ) ( a) ,
30203028 ( StatementKind :: InlineAsm ) { asm, outputs, inputs } ,
30213029 ( StatementKind :: Retag ) { fn_entry, place } ,
3030+ ( StatementKind :: EscapeToRaw ) ( place) ,
30223031 ( StatementKind :: EndRegion ) ( a) ,
30233032 ( StatementKind :: AscribeUserType ) ( a, v, b) ,
30243033 ( StatementKind :: Nop ) ,
0 commit comments