44
55use  crate :: hir:: def:: { CtorKind ,  Namespace } ; 
66use  crate :: hir:: def_id:: DefId ; 
7- use  crate :: hir:: { self ,  HirId ,  InlineAsm } ; 
7+ use  crate :: hir:: { self ,  HirId ,  InlineAsm   as   HirInlineAsm } ; 
88use  crate :: mir:: interpret:: { ConstValue ,  InterpError ,  Scalar } ; 
99use  crate :: mir:: visit:: MirVisitable ; 
1010use  rustc_apfloat:: ieee:: { Double ,  Single } ; 
@@ -1735,7 +1735,7 @@ pub struct Statement<'tcx> {
17351735
17361736// `Statement` is used a lot. Make sure it doesn't unintentionally get bigger. 
17371737#[ cfg( target_arch = "x86_64" ) ]  
1738- static_assert ! ( MEM_SIZE_OF_STATEMENT :  mem:: size_of:: <Statement <' _>>( )  == 56 ) ; 
1738+ static_assert ! ( MEM_SIZE_OF_STATEMENT :  mem:: size_of:: <Statement <' _>>( )  == 48 ) ; 
17391739
17401740impl < ' tcx >  Statement < ' tcx >  { 
17411741    /// Changes a statement to a nop. This is both faster than deleting instructions and avoids 
@@ -1779,12 +1779,9 @@ pub enum StatementKind<'tcx> {
17791779    /// End the current live range for the storage of the local. 
17801780StorageDead ( Local ) , 
17811781
1782-     /// Executes a piece of inline Assembly. 
1783- InlineAsm  { 
1784-         asm :  Box < InlineAsm > , 
1785-         outputs :  Box < [ Place < ' tcx > ] > , 
1786-         inputs :  Box < [ ( Span ,  Operand < ' tcx > ) ] > , 
1787-     } , 
1782+     /// Executes a piece of inline Assembly. Stored in a Box to keep the size 
1783+ /// of `StatementKind` low. 
1784+ InlineAsm ( Box < InlineAsm < ' tcx > > ) , 
17881785
17891786    /// Retag references in the given place, ensuring they got fresh tags. This is 
17901787/// part of the Stacked Borrows model. These statements are currently only interpreted 
@@ -1858,6 +1855,13 @@ pub enum FakeReadCause {
18581855ForLet , 
18591856} 
18601857
1858+ #[ derive( Clone ,  Debug ,  RustcEncodable ,  RustcDecodable ,  HashStable ) ]  
1859+ pub  struct  InlineAsm < ' tcx >  { 
1860+     pub  asm :  HirInlineAsm , 
1861+     pub  outputs :  Box < [ Place < ' tcx > ] > , 
1862+     pub  inputs :  Box < [ ( Span ,  Operand < ' tcx > ) ] > , 
1863+ } 
1864+ 
18611865impl < ' tcx >  Debug  for  Statement < ' tcx >  { 
18621866    fn  fmt ( & self ,  fmt :  & mut  Formatter < ' _ > )  -> fmt:: Result  { 
18631867        use  self :: StatementKind :: * ; 
@@ -1880,11 +1884,8 @@ impl<'tcx> Debug for Statement<'tcx> {
18801884                ref  place, 
18811885                variant_index, 
18821886            }  => write ! ( fmt,  "discriminant({:?}) = {:?}" ,  place,  variant_index) , 
1883-             InlineAsm  { 
1884-                 ref  asm, 
1885-                 ref  outputs, 
1886-                 ref  inputs, 
1887-             }  => write ! ( fmt,  "asm!({:?} : {:?} : {:?})" ,  asm,  outputs,  inputs) , 
1887+             InlineAsm ( ref  asm)  =>
1888+                 write ! ( fmt,  "asm!({:?} : {:?} : {:?})" ,  asm. asm,  asm. outputs,  asm. inputs) , 
18881889            AscribeUserType ( ref  place,  ref  variance,  ref  c_ty)  => { 
18891890                write ! ( fmt,  "AscribeUserType({:?}, {:?}, {:?})" ,  place,  variance,  c_ty) 
18901891            } 
@@ -3149,13 +3150,21 @@ EnumTypeFoldableImpl! {
31493150        ( StatementKind :: SetDiscriminant )  {  place,  variant_index } , 
31503151        ( StatementKind :: StorageLive ) ( a) , 
31513152        ( StatementKind :: StorageDead ) ( a) , 
3152-         ( StatementKind :: InlineAsm )   {  asm ,  outputs ,  inputs  } , 
3153+         ( StatementKind :: InlineAsm ) ( a ) , 
31533154        ( StatementKind :: Retag ) ( kind,  place) , 
31543155        ( StatementKind :: AscribeUserType ) ( a,  v,  b) , 
31553156        ( StatementKind :: Nop ) , 
31563157    } 
31573158} 
31583159
3160+ BraceStructTypeFoldableImpl !  { 
3161+     impl <' tcx> TypeFoldable <' tcx> for  InlineAsm <' tcx> { 
3162+         asm, 
3163+         outputs, 
3164+         inputs, 
3165+     } 
3166+ } 
3167+ 
31593168EnumTypeFoldableImpl !  { 
31603169    impl <' tcx,  T > TypeFoldable <' tcx> for  ClearCrossCrate <T > { 
31613170        ( ClearCrossCrate :: Clear ) , 
0 commit comments