@@ -147,7 +147,7 @@ pub enum Provenance {
147
147
Concrete {
148
148
alloc_id : AllocId ,
149
149
/// Stacked Borrows tag.
150
- sb : SbTag ,
150
+ tag : BorTag ,
151
151
} ,
152
152
Wildcard ,
153
153
}
@@ -173,7 +173,7 @@ impl std::hash::Hash for Provenance {
173
173
/// The "extra" information a pointer has over a regular AllocId.
174
174
#[ derive( Copy , Clone , PartialEq ) ]
175
175
pub enum ProvenanceExtra {
176
- Concrete ( SbTag ) ,
176
+ Concrete ( BorTag ) ,
177
177
Wildcard ,
178
178
}
179
179
@@ -188,15 +188,15 @@ static_assert_size!(Scalar<Provenance>, 32);
188
188
impl fmt:: Debug for Provenance {
189
189
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
190
190
match self {
191
- Provenance :: Concrete { alloc_id, sb } => {
191
+ Provenance :: Concrete { alloc_id, tag } => {
192
192
// Forward `alternate` flag to `alloc_id` printing.
193
193
if f. alternate ( ) {
194
194
write ! ( f, "[{alloc_id:#?}]" ) ?;
195
195
} else {
196
196
write ! ( f, "[{alloc_id:?}]" ) ?;
197
197
}
198
198
// Print Stacked Borrows tag.
199
- write ! ( f, "{sb :?}" ) ?;
199
+ write ! ( f, "{tag :?}" ) ?;
200
200
}
201
201
Provenance :: Wildcard => {
202
202
write ! ( f, "[wildcard]" ) ?;
@@ -221,9 +221,9 @@ impl interpret::Provenance for Provenance {
221
221
match ( left, right) {
222
222
// If both are the *same* concrete tag, that is the result.
223
223
(
224
- Some ( Provenance :: Concrete { alloc_id : left_alloc, sb : left_sb } ) ,
225
- Some ( Provenance :: Concrete { alloc_id : right_alloc, sb : right_sb } ) ,
226
- ) if left_alloc == right_alloc && left_sb == right_sb => left,
224
+ Some ( Provenance :: Concrete { alloc_id : left_alloc, tag : left_tag } ) ,
225
+ Some ( Provenance :: Concrete { alloc_id : right_alloc, tag : right_tag } ) ,
226
+ ) if left_alloc == right_alloc && left_tag == right_tag => left,
227
227
// If one side is a wildcard, the best possible outcome is that it is equal to the other
228
228
// one, and we use that.
229
229
( Some ( Provenance :: Wildcard ) , o) | ( o, Some ( Provenance :: Wildcard ) ) => o,
@@ -243,7 +243,7 @@ impl fmt::Debug for ProvenanceExtra {
243
243
}
244
244
245
245
impl ProvenanceExtra {
246
- pub fn and_then < T > ( self , f : impl FnOnce ( SbTag ) -> Option < T > ) -> Option < T > {
246
+ pub fn and_then < T > ( self , f : impl FnOnce ( BorTag ) -> Option < T > ) -> Option < T > {
247
247
match self {
248
248
ProvenanceExtra :: Concrete ( pid) => f ( pid) ,
249
249
ProvenanceExtra :: Wildcard => None ,
@@ -463,9 +463,9 @@ pub struct MiriMachine<'mir, 'tcx> {
463
463
#[ cfg( not( target_os = "linux" ) ) ]
464
464
pub external_so_lib : Option < !> ,
465
465
466
- /// Run a garbage collector for SbTags every N basic blocks.
466
+ /// Run a garbage collector for BorTags every N basic blocks.
467
467
pub ( crate ) gc_interval : u32 ,
468
- /// The number of blocks that passed since the last SbTag GC pass.
468
+ /// The number of blocks that passed since the last BorTag GC pass.
469
469
pub ( crate ) since_gc : u32 ,
470
470
/// The number of CPUs to be reported by miri.
471
471
pub ( crate ) num_cpus : u32 ,
@@ -656,7 +656,7 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
656
656
}
657
657
658
658
impl VisitTags for MiriMachine < ' _ , ' _ > {
659
- fn visit_tags ( & self , visit : & mut dyn FnMut ( SbTag ) ) {
659
+ fn visit_tags ( & self , visit : & mut dyn FnMut ( BorTag ) ) {
660
660
#[ rustfmt:: skip]
661
661
let MiriMachine {
662
662
threads,
@@ -959,10 +959,10 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
959
959
stacked_borrows. borrow_mut ( ) . base_ptr_tag ( ptr. provenance , & ecx. machine )
960
960
} else {
961
961
// Value does not matter, SB is disabled
962
- SbTag :: default ( )
962
+ BorTag :: default ( )
963
963
} ;
964
964
Pointer :: new (
965
- Provenance :: Concrete { alloc_id : ptr. provenance , sb : sb_tag } ,
965
+ Provenance :: Concrete { alloc_id : ptr. provenance , tag } ,
966
966
Size :: from_bytes ( absolute_addr) ,
967
967
)
968
968
}
@@ -980,8 +980,8 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
980
980
ptr : Pointer < Self :: Provenance > ,
981
981
) -> InterpResult < ' tcx > {
982
982
match ptr. provenance {
983
- Provenance :: Concrete { alloc_id, sb } =>
984
- intptrcast:: GlobalStateInner :: expose_ptr ( ecx, alloc_id, sb ) ,
983
+ Provenance :: Concrete { alloc_id, tag } =>
984
+ intptrcast:: GlobalStateInner :: expose_ptr ( ecx, alloc_id, tag ) ,
985
985
Provenance :: Wildcard => {
986
986
// No need to do anything for wildcard pointers as
987
987
// their provenances have already been previously exposed.
@@ -999,11 +999,11 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
999
999
let rel = intptrcast:: GlobalStateInner :: abs_ptr_to_rel ( ecx, ptr) ;
1000
1000
1001
1001
rel. map ( |( alloc_id, size) | {
1002
- let sb = match ptr. provenance {
1003
- Provenance :: Concrete { sb , .. } => ProvenanceExtra :: Concrete ( sb ) ,
1002
+ let tag = match ptr. provenance {
1003
+ Provenance :: Concrete { tag , .. } => ProvenanceExtra :: Concrete ( tag ) ,
1004
1004
Provenance :: Wildcard => ProvenanceExtra :: Wildcard ,
1005
1005
} ;
1006
- ( alloc_id, size, sb )
1006
+ ( alloc_id, size, tag )
1007
1007
} )
1008
1008
}
1009
1009
0 commit comments