@@ -47,9 +47,9 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
47
47
/// will be true if this is frozen, false if this is in an `UnsafeCell`.
48
48
fn visit_freeze_sensitive (
49
49
& self ,
50
- place : MPlaceTy < ' tcx , Borrow > ,
50
+ place : MPlaceTy < ' tcx , Tag > ,
51
51
size : Size ,
52
- mut action : impl FnMut ( Pointer < Borrow > , Size , bool ) -> EvalResult < ' tcx > ,
52
+ mut action : impl FnMut ( Pointer < Tag > , Size , bool ) -> EvalResult < ' tcx > ,
53
53
) -> EvalResult < ' tcx > {
54
54
let this = self . eval_context_ref ( ) ;
55
55
trace ! ( "visit_frozen(place={:?}, size={:?})" , * place, size) ;
@@ -64,7 +64,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
64
64
let mut end_ptr = place. ptr ;
65
65
// Called when we detected an `UnsafeCell` at the given offset and size.
66
66
// Calls `action` and advances `end_ptr`.
67
- let mut unsafe_cell_action = |unsafe_cell_ptr : Scalar < Borrow > , unsafe_cell_size : Size | {
67
+ let mut unsafe_cell_action = |unsafe_cell_ptr : Scalar < Tag > , unsafe_cell_size : Size | {
68
68
if unsafe_cell_size != Size :: ZERO {
69
69
debug_assert_eq ! ( unsafe_cell_ptr. to_ptr( ) . unwrap( ) . alloc_id,
70
70
end_ptr. to_ptr( ) . unwrap( ) . alloc_id) ;
@@ -120,7 +120,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
120
120
/// Visiting the memory covered by a `MemPlace`, being aware of
121
121
/// whether we are inside an `UnsafeCell` or not.
122
122
struct UnsafeCellVisitor < ' ecx , ' a , ' mir , ' tcx , F >
123
- where F : FnMut ( MPlaceTy < ' tcx , Borrow > ) -> EvalResult < ' tcx >
123
+ where F : FnMut ( MPlaceTy < ' tcx , Tag > ) -> EvalResult < ' tcx >
124
124
{
125
125
ecx : & ' ecx MiriEvalContext < ' a , ' mir , ' tcx > ,
126
126
unsafe_cell_action : F ,
@@ -131,17 +131,17 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
131
131
for
132
132
UnsafeCellVisitor < ' ecx , ' a , ' mir , ' tcx , F >
133
133
where
134
- F : FnMut ( MPlaceTy < ' tcx , Borrow > ) -> EvalResult < ' tcx >
134
+ F : FnMut ( MPlaceTy < ' tcx , Tag > ) -> EvalResult < ' tcx >
135
135
{
136
- type V = MPlaceTy < ' tcx , Borrow > ;
136
+ type V = MPlaceTy < ' tcx , Tag > ;
137
137
138
138
#[ inline( always) ]
139
139
fn ecx ( & self ) -> & MiriEvalContext < ' a , ' mir , ' tcx > {
140
140
& self . ecx
141
141
}
142
142
143
143
// Hook to detect `UnsafeCell`.
144
- fn visit_value ( & mut self , v : MPlaceTy < ' tcx , Borrow > ) -> EvalResult < ' tcx >
144
+ fn visit_value ( & mut self , v : MPlaceTy < ' tcx , Tag > ) -> EvalResult < ' tcx >
145
145
{
146
146
trace ! ( "UnsafeCellVisitor: {:?} {:?}" , * v, v. layout. ty) ;
147
147
let is_unsafe_cell = match v. layout . ty . sty {
@@ -163,8 +163,8 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
163
163
// Make sure we visit aggregrates in increasing offset order.
164
164
fn visit_aggregate (
165
165
& mut self ,
166
- place : MPlaceTy < ' tcx , Borrow > ,
167
- fields : impl Iterator < Item =EvalResult < ' tcx , MPlaceTy < ' tcx , Borrow > > > ,
166
+ place : MPlaceTy < ' tcx , Tag > ,
167
+ fields : impl Iterator < Item =EvalResult < ' tcx , MPlaceTy < ' tcx , Tag > > > ,
168
168
) -> EvalResult < ' tcx > {
169
169
match place. layout . fields {
170
170
layout:: FieldPlacement :: Array { .. } => {
@@ -174,7 +174,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
174
174
}
175
175
layout:: FieldPlacement :: Arbitrary { .. } => {
176
176
// Gather the subplaces and sort them before visiting.
177
- let mut places = fields. collect :: < EvalResult < ' tcx , Vec < MPlaceTy < ' tcx , Borrow > > > > ( ) ?;
177
+ let mut places = fields. collect :: < EvalResult < ' tcx , Vec < MPlaceTy < ' tcx , Tag > > > > ( ) ?;
178
178
places. sort_by_key ( |place| place. ptr . get_ptr_offset ( self . ecx ( ) ) ) ;
179
179
self . walk_aggregate ( place, places. into_iter ( ) . map ( Ok ) )
180
180
}
@@ -186,7 +186,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
186
186
}
187
187
188
188
// We have to do *something* for unions.
189
- fn visit_union ( & mut self , v : MPlaceTy < ' tcx , Borrow > ) -> EvalResult < ' tcx >
189
+ fn visit_union ( & mut self , v : MPlaceTy < ' tcx , Tag > ) -> EvalResult < ' tcx >
190
190
{
191
191
// With unions, we fall back to whatever the type says, to hopefully be consistent
192
192
// with LLVM IR.
@@ -200,7 +200,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
200
200
}
201
201
202
202
// We should never get to a primitive, but always short-circuit somewhere above.
203
- fn visit_primitive ( & mut self , _v : MPlaceTy < ' tcx , Borrow > ) -> EvalResult < ' tcx >
203
+ fn visit_primitive ( & mut self , _v : MPlaceTy < ' tcx , Tag > ) -> EvalResult < ' tcx >
204
204
{
205
205
bug ! ( "we should always short-circuit before coming to a primitive" )
206
206
}
0 commit comments