@@ -63,7 +63,7 @@ pub enum AllocKind {
63
63
/// A function allocation (that fn ptrs point to).
64
64
Function ,
65
65
/// A (symbolic) vtable allocation.
66
- Vtable ,
66
+ VTable ,
67
67
/// A dead allocation.
68
68
Dead ,
69
69
}
@@ -293,7 +293,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
293
293
Some ( GlobalAlloc :: Function ( ..) ) => {
294
294
err_ub_format ! ( "deallocating {alloc_id:?}, which is a function" )
295
295
}
296
- Some ( GlobalAlloc :: Vtable ( ..) ) => {
296
+ Some ( GlobalAlloc :: VTable ( ..) ) => {
297
297
err_ub_format ! ( "deallocating {alloc_id:?}, which is a vtable" )
298
298
}
299
299
Some ( GlobalAlloc :: Static ( ..) | GlobalAlloc :: Memory ( ..) ) => {
@@ -484,7 +484,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
484
484
( mem, None )
485
485
}
486
486
Some ( GlobalAlloc :: Function ( ..) ) => throw_ub ! ( DerefFunctionPointer ( id) ) ,
487
- Some ( GlobalAlloc :: Vtable ( ..) ) => throw_ub ! ( DerefVtablePointer ( id) ) ,
487
+ Some ( GlobalAlloc :: VTable ( ..) ) => throw_ub ! ( DerefVTablePointer ( id) ) ,
488
488
None => throw_ub ! ( PointerUseAfterFree ( id) ) ,
489
489
Some ( GlobalAlloc :: Static ( def_id) ) => {
490
490
assert ! ( self . tcx. is_static( def_id) ) ;
@@ -688,9 +688,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
688
688
( alloc. size ( ) , alloc. align , AllocKind :: LiveData )
689
689
}
690
690
Some ( GlobalAlloc :: Function ( _) ) => bug ! ( "We already checked function pointers above" ) ,
691
- Some ( GlobalAlloc :: Vtable ( ..) ) => {
691
+ Some ( GlobalAlloc :: VTable ( ..) ) => {
692
692
// No data to be accessed here. But vtables are pointer-aligned.
693
- return ( Size :: ZERO , self . tcx . data_layout . pointer_align . abi , AllocKind :: Vtable ) ;
693
+ return ( Size :: ZERO , self . tcx . data_layout . pointer_align . abi , AllocKind :: VTable ) ;
694
694
}
695
695
// The rest must be dead.
696
696
None => {
@@ -746,11 +746,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
746
746
trace ! ( "get_ptr_vtable({:?})" , ptr) ;
747
747
let ( alloc_id, offset, _tag) = self . ptr_get_alloc_id ( ptr) ?;
748
748
if offset. bytes ( ) != 0 {
749
- throw_ub ! ( InvalidVtablePointer ( Pointer :: new( alloc_id, offset) ) )
749
+ throw_ub ! ( InvalidVTablePointer ( Pointer :: new( alloc_id, offset) ) )
750
750
}
751
751
match self . tcx . try_get_global_alloc ( alloc_id) {
752
- Some ( GlobalAlloc :: Vtable ( ty, trait_ref) ) => Ok ( ( ty, trait_ref) ) ,
753
- _ => throw_ub ! ( InvalidVtablePointer ( Pointer :: new( alloc_id, offset) ) ) ,
752
+ Some ( GlobalAlloc :: VTable ( ty, trait_ref) ) => Ok ( ( ty, trait_ref) ) ,
753
+ _ => throw_ub ! ( InvalidVTablePointer ( Pointer :: new( alloc_id, offset) ) ) ,
754
754
}
755
755
}
756
756
@@ -871,10 +871,10 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> std::fmt::Debug for DumpAllocs<'a,
871
871
Some ( GlobalAlloc :: Function ( func) ) => {
872
872
write ! ( fmt, " (fn: {func})" ) ?;
873
873
}
874
- Some ( GlobalAlloc :: Vtable ( ty, Some ( trait_ref) ) ) => {
874
+ Some ( GlobalAlloc :: VTable ( ty, Some ( trait_ref) ) ) => {
875
875
write ! ( fmt, " (vtable: impl {trait_ref} for {ty})" ) ?;
876
876
}
877
- Some ( GlobalAlloc :: Vtable ( ty, None ) ) => {
877
+ Some ( GlobalAlloc :: VTable ( ty, None ) ) => {
878
878
write ! ( fmt, " (vtable: impl <auto trait> for {ty})" ) ?;
879
879
}
880
880
Some ( GlobalAlloc :: Static ( did) ) => {
0 commit comments