@@ -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 ( ..) ) => {
@@ -480,7 +480,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
480
480
( mem, None )
481
481
}
482
482
Some ( GlobalAlloc :: Function ( ..) ) => throw_ub ! ( DerefFunctionPointer ( id) ) ,
483
- Some ( GlobalAlloc :: Vtable ( ..) ) => throw_ub ! ( DerefVtablePointer ( id) ) ,
483
+ Some ( GlobalAlloc :: VTable ( ..) ) => throw_ub ! ( DerefVTablePointer ( id) ) ,
484
484
None => throw_ub ! ( PointerUseAfterFree ( id) ) ,
485
485
Some ( GlobalAlloc :: Static ( def_id) ) => {
486
486
assert ! ( self . tcx. is_static( def_id) ) ;
@@ -684,9 +684,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
684
684
( alloc. size ( ) , alloc. align , AllocKind :: LiveData )
685
685
}
686
686
Some ( GlobalAlloc :: Function ( _) ) => bug ! ( "We already checked function pointers above" ) ,
687
- Some ( GlobalAlloc :: Vtable ( ..) ) => {
687
+ Some ( GlobalAlloc :: VTable ( ..) ) => {
688
688
// No data to be accessed here. But vtables are pointer-aligned.
689
- return ( Size :: ZERO , self . tcx . data_layout . pointer_align . abi , AllocKind :: Vtable ) ;
689
+ return ( Size :: ZERO , self . tcx . data_layout . pointer_align . abi , AllocKind :: VTable ) ;
690
690
}
691
691
// The rest must be dead.
692
692
None => {
@@ -742,11 +742,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
742
742
trace ! ( "get_ptr_vtable({:?})" , ptr) ;
743
743
let ( alloc_id, offset, _tag) = self . ptr_get_alloc_id ( ptr) ?;
744
744
if offset. bytes ( ) != 0 {
745
- throw_ub ! ( InvalidVtablePointer ( Pointer :: new( alloc_id, offset) ) )
745
+ throw_ub ! ( InvalidVTablePointer ( Pointer :: new( alloc_id, offset) ) )
746
746
}
747
747
match self . tcx . try_get_global_alloc ( alloc_id) {
748
- Some ( GlobalAlloc :: Vtable ( ty, trait_ref) ) => Ok ( ( ty, trait_ref) ) ,
749
- _ => throw_ub ! ( InvalidVtablePointer ( Pointer :: new( alloc_id, offset) ) ) ,
748
+ Some ( GlobalAlloc :: VTable ( ty, trait_ref) ) => Ok ( ( ty, trait_ref) ) ,
749
+ _ => throw_ub ! ( InvalidVTablePointer ( Pointer :: new( alloc_id, offset) ) ) ,
750
750
}
751
751
}
752
752
@@ -867,10 +867,10 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> std::fmt::Debug for DumpAllocs<'a,
867
867
Some ( GlobalAlloc :: Function ( func) ) => {
868
868
write ! ( fmt, " (fn: {func})" ) ?;
869
869
}
870
- Some ( GlobalAlloc :: Vtable ( ty, Some ( trait_ref) ) ) => {
870
+ Some ( GlobalAlloc :: VTable ( ty, Some ( trait_ref) ) ) => {
871
871
write ! ( fmt, " (vtable: impl {trait_ref} for {ty})" ) ?;
872
872
}
873
- Some ( GlobalAlloc :: Vtable ( ty, None ) ) => {
873
+ Some ( GlobalAlloc :: VTable ( ty, None ) ) => {
874
874
write ! ( fmt, " (vtable: impl <auto trait> for {ty})" ) ?;
875
875
}
876
876
Some ( GlobalAlloc :: Static ( did) ) => {
0 commit comments