File tree 6 files changed +20
-9
lines changed
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;
9
9
use std:: fmt:: Write ;
10
10
use std:: { cmp, mem} ;
11
11
12
+ use rustc_abi:: { BackendRepr , Size } ;
12
13
use rustc_data_structures:: fx:: FxHashSet ;
13
14
use rustc_middle:: mir:: { Mutability , RetagKind } ;
14
15
use rustc_middle:: ty:: layout:: HasParamEnv ;
15
16
use rustc_middle:: ty:: { self , Ty } ;
16
- use rustc_target:: abi:: { Abi , Size } ;
17
17
18
18
use self :: diagnostics:: { RetagCause , RetagInfo } ;
19
19
pub use self :: item:: { Item , Permission } ;
@@ -972,7 +972,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
972
972
RetagFields :: OnlyScalar => {
973
973
// Matching `ArgAbi::new` at the time of writing, only fields of
974
974
// `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
+ )
976
979
}
977
980
} ;
978
981
if recurse {
Original file line number Diff line number Diff line change
1
+ use rustc_abi:: { BackendRepr , Size } ;
1
2
use rustc_middle:: mir:: { Mutability , RetagKind } ;
2
3
use rustc_middle:: ty:: layout:: HasParamEnv ;
3
4
use rustc_middle:: ty:: { self , Ty } ;
4
5
use rustc_span:: def_id:: DefId ;
5
- use rustc_target:: abi:: { Abi , Size } ;
6
6
7
7
use crate :: borrow_tracker:: { GlobalState , GlobalStateInner , ProtectorKind } ;
8
8
use crate :: concurrency:: data_race:: NaReadType ;
@@ -495,7 +495,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
495
495
RetagFields :: OnlyScalar => {
496
496
// Matching `ArgAbi::new` at the time of writing, only fields of
497
497
// `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
+ )
499
502
}
500
503
} ;
501
504
if recurse {
Original file line number Diff line number Diff line change @@ -349,8 +349,12 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
349
349
i : impl Into < i128 > ,
350
350
dest : & impl Writeable < ' tcx , Provenance > ,
351
351
) -> 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 ( ) {
354
358
Scalar :: from_int ( i, dest. layout ( ) . size )
355
359
} else {
356
360
// `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;
55
55
extern crate tracing;
56
56
57
57
// The rustc crates we need
58
+ extern crate rustc_abi;
58
59
extern crate rustc_apfloat;
59
60
extern crate rustc_ast;
60
61
extern crate rustc_attr;
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
23
23
24
24
interp_ok ( match bin_op {
25
25
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`
27
27
let size = this. pointer_size ( ) ;
28
28
// Just compare the bits. ScalarPairs are compared lexicographically.
29
29
// 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;
5
5
use libffi:: low:: CodePtr ;
6
6
use rustc_middle:: ty:: { self as ty, IntTy , UintTy } ;
7
7
use rustc_span:: Symbol ;
8
- use rustc_target :: abi :: { Abi , HasDataLayout } ;
8
+ use rustc_abi :: { BackendRepr , HasDataLayout } ;
9
9
10
10
use crate :: * ;
11
11
@@ -149,7 +149,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
149
149
// Get the function arguments, and convert them to `libffi`-compatible form.
150
150
let mut libffi_args = Vec :: < CArg > :: with_capacity ( args. len ( ) ) ;
151
151
for arg in args. iter ( ) {
152
- if !matches ! ( arg. layout. abi , Abi :: Scalar ( _) ) {
152
+ if !matches ! ( arg. layout. backend_repr , BackendRepr :: Scalar ( _) ) {
153
153
throw_unsup_format ! ( "only scalar argument types are support for native calls" )
154
154
}
155
155
libffi_args. push ( imm_to_carg ( this. read_immediate ( arg) ?, this) ?) ;
You can’t perform that action at this time.
0 commit comments