1
1
use rustc_abi:: { ExternAbi , Size } ;
2
+ use rustc_ast:: ast:: Mutability ;
2
3
use rustc_middle:: ty:: layout:: LayoutOf as _;
3
4
use rustc_middle:: ty:: { self , Instance , Ty } ;
4
5
use rustc_span:: { BytePos , Loc , Symbol , hygiene} ;
6
+ use rustc_target:: callconv:: FnAbi ;
7
+ use rustc_target:: callconv:: Conv ;
5
8
6
9
use crate :: helpers:: check_min_arg_count;
7
10
use crate :: * ;
@@ -10,13 +13,13 @@ impl<'tcx> EvalContextExt<'tcx> for crate::MiriInterpCx<'tcx> {}
10
13
pub trait EvalContextExt < ' tcx > : crate :: MiriInterpCxExt < ' tcx > {
11
14
fn handle_miri_backtrace_size (
12
15
& mut self ,
13
- abi : ExternAbi ,
16
+ abi : & FnAbi < ' tcx , Ty < ' tcx > > ,
14
17
link_name : Symbol ,
15
18
args : & [ OpTy < ' tcx > ] ,
16
19
dest : & MPlaceTy < ' tcx > ,
17
20
) -> InterpResult < ' tcx > {
18
21
let this = self . eval_context_mut ( ) ;
19
- let [ flags] = this. check_shim ( abi, ExternAbi :: Rust , link_name, args) ?;
22
+ let [ flags] = this. check_shim ( abi, Conv :: Rust , link_name, args) ?;
20
23
21
24
let flags = this. read_scalar ( flags) ?. to_u64 ( ) ?;
22
25
if flags != 0 {
@@ -30,7 +33,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
30
33
31
34
fn handle_miri_get_backtrace (
32
35
& mut self ,
33
- abi : ExternAbi ,
36
+ abi : & FnAbi < ' tcx , Ty < ' tcx > > ,
34
37
link_name : Symbol ,
35
38
args : & [ OpTy < ' tcx > ] ,
36
39
dest : & MPlaceTy < ' tcx > ,
@@ -71,7 +74,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
71
74
// storage for pointers is allocated by miri
72
75
// deallocating the slice is undefined behavior with a custom global allocator
73
76
0 => {
74
- let [ _flags] = this. check_shim ( abi, ExternAbi :: Rust , link_name, args) ?;
77
+ let [ _flags] = this. check_shim ( abi, Conv :: Rust , link_name, args) ?;
75
78
76
79
let alloc = this. allocate ( array_layout, MiriMemoryKind :: Rust . into ( ) ) ?;
77
80
@@ -86,7 +89,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
86
89
}
87
90
// storage for pointers is allocated by the caller
88
91
1 => {
89
- let [ _flags, buf] = this. check_shim ( abi, ExternAbi :: Rust , link_name, args) ?;
92
+ let [ _flags, buf] = this. check_shim ( abi, Conv :: Rust , link_name, args) ?;
90
93
91
94
let buf_place = this. deref_pointer ( buf) ?;
92
95
@@ -136,13 +139,13 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
136
139
137
140
fn handle_miri_resolve_frame (
138
141
& mut self ,
139
- abi : ExternAbi ,
142
+ abi : & FnAbi < ' tcx , Ty < ' tcx > > ,
140
143
link_name : Symbol ,
141
144
args : & [ OpTy < ' tcx > ] ,
142
145
dest : & MPlaceTy < ' tcx > ,
143
146
) -> InterpResult < ' tcx > {
144
147
let this = self . eval_context_mut ( ) ;
145
- let [ ptr, flags] = this. check_shim ( abi, ExternAbi :: Rust , link_name, args) ?;
148
+ let [ ptr, flags] = this. check_shim ( abi, Conv :: Rust , link_name, args) ?;
146
149
147
150
let flags = this. read_scalar ( flags) ?. to_u64 ( ) ?;
148
151
@@ -207,14 +210,14 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
207
210
208
211
fn handle_miri_resolve_frame_names (
209
212
& mut self ,
210
- abi : ExternAbi ,
213
+ abi : & FnAbi < ' tcx , Ty < ' tcx > > ,
211
214
link_name : Symbol ,
212
215
args : & [ OpTy < ' tcx > ] ,
213
216
) -> InterpResult < ' tcx > {
214
217
let this = self . eval_context_mut ( ) ;
215
218
216
219
let [ ptr, flags, name_ptr, filename_ptr] =
217
- this. check_shim ( abi, ExternAbi :: Rust , link_name, args) ?;
220
+ this. check_shim ( abi, Conv :: Rust , link_name, args) ?;
218
221
219
222
let flags = this. read_scalar ( flags) ?. to_u64 ( ) ?;
220
223
if flags != 0 {
0 commit comments