File tree Expand file tree Collapse file tree 6 files changed +20
-9
lines changed Expand file tree Collapse file tree 6 files changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,11 @@ use std::cell::RefCell;
99use std:: fmt:: Write ;
1010use std:: { cmp, mem} ;
1111
12+ use rustc_abi:: { BackendRepr , Size } ;
1213use rustc_data_structures:: fx:: FxHashSet ;
1314use rustc_middle:: mir:: { Mutability , RetagKind } ;
1415use rustc_middle:: ty:: layout:: HasParamEnv ;
1516use rustc_middle:: ty:: { self , Ty } ;
16- use rustc_target:: abi:: { Abi , Size } ;
1717
1818use self :: diagnostics:: { RetagCause , RetagInfo } ;
1919pub use self :: item:: { Item , Permission } ;
@@ -972,7 +972,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
972972 RetagFields :: OnlyScalar => {
973973 // Matching `ArgAbi::new` at the time of writing, only fields of
974974 // `Scalar` and `ScalarPair` ABI are considered.
975- matches ! ( place. layout. abi, Abi :: Scalar ( ..) | Abi :: ScalarPair ( ..) )
975+ matches ! (
976+ place. layout. backend_repr,
977+ BackendRepr :: Scalar ( ..) | BackendRepr :: ScalarPair ( ..)
978+ )
976979 }
977980 } ;
978981 if recurse {
Original file line number Diff line number Diff line change 1+ use rustc_abi:: { BackendRepr , Size } ;
12use rustc_middle:: mir:: { Mutability , RetagKind } ;
23use rustc_middle:: ty:: layout:: HasParamEnv ;
34use rustc_middle:: ty:: { self , Ty } ;
45use rustc_span:: def_id:: DefId ;
5- use rustc_target:: abi:: { Abi , Size } ;
66
77use crate :: borrow_tracker:: { GlobalState , GlobalStateInner , ProtectorKind } ;
88use crate :: concurrency:: data_race:: NaReadType ;
@@ -495,7 +495,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
495495 RetagFields :: OnlyScalar => {
496496 // Matching `ArgAbi::new` at the time of writing, only fields of
497497 // `Scalar` and `ScalarPair` ABI are considered.
498- matches ! ( place. layout. abi, Abi :: Scalar ( ..) | Abi :: ScalarPair ( ..) )
498+ matches ! (
499+ place. layout. backend_repr,
500+ BackendRepr :: Scalar ( ..) | BackendRepr :: ScalarPair ( ..)
501+ )
499502 }
500503 } ;
501504 if recurse {
Original file line number Diff line number Diff line change @@ -349,8 +349,12 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
349349 i : impl Into < i128 > ,
350350 dest : & impl Writeable < ' tcx , Provenance > ,
351351 ) -> InterpResult < ' tcx > {
352- assert ! ( dest. layout( ) . abi. is_scalar( ) , "write_int on non-scalar type {}" , dest. layout( ) . ty) ;
353- let val = if dest. layout ( ) . abi . is_signed ( ) {
352+ assert ! (
353+ dest. layout( ) . backend_repr. is_scalar( ) ,
354+ "write_int on non-scalar type {}" ,
355+ dest. layout( ) . ty
356+ ) ;
357+ let val = if dest. layout ( ) . backend_repr . is_signed ( ) {
354358 Scalar :: from_int ( i, dest. layout ( ) . size )
355359 } else {
356360 // `unwrap` can only fail here if `i` is negative
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ extern crate either;
5555extern crate tracing;
5656
5757// The rustc crates we need
58+ extern crate rustc_abi;
5859extern crate rustc_apfloat;
5960extern crate rustc_ast;
6061extern crate rustc_attr;
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
2323
2424 interp_ok ( match bin_op {
2525 Eq | Ne | Lt | Le | Gt | Ge => {
26- assert_eq ! ( left. layout. abi , right. layout. abi ) ; // types can differ, e.g. fn ptrs with different `for`
26+ assert_eq ! ( left. layout. backend_repr , right. layout. backend_repr ) ; // types can differ, e.g. fn ptrs with different `for`
2727 let size = this. pointer_size ( ) ;
2828 // Just compare the bits. ScalarPairs are compared lexicographically.
2929 // We thus always compare pairs and simply fill scalars up with 0.
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use libffi::high::call as ffi;
55use libffi:: low:: CodePtr ;
66use rustc_middle:: ty:: { self as ty, IntTy , UintTy } ;
77use rustc_span:: Symbol ;
8- use rustc_target :: abi :: { Abi , HasDataLayout } ;
8+ use rustc_abi :: { BackendRepr , HasDataLayout } ;
99
1010use crate :: * ;
1111
@@ -149,7 +149,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
149149 // Get the function arguments, and convert them to `libffi`-compatible form.
150150 let mut libffi_args = Vec :: < CArg > :: with_capacity ( args. len ( ) ) ;
151151 for arg in args. iter ( ) {
152- if !matches ! ( arg. layout. abi , Abi :: Scalar ( _) ) {
152+ if !matches ! ( arg. layout. backend_repr , BackendRepr :: Scalar ( _) ) {
153153 throw_unsup_format ! ( "only scalar argument types are support for native calls" )
154154 }
155155 libffi_args. push ( imm_to_carg ( this. read_immediate ( arg) ?, this) ?) ;
You can’t perform that action at this time.
0 commit comments