Skip to content

Commit a1b1722

Browse files
committed
consistently use VTable over Vtable (matching stable stdlib API RawWakerVTable)
1 parent b5cce74 commit a1b1722

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/constant.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ pub(crate) fn codegen_const_value<'tcx>(
197197
let (alloc_id, offset) = ptr.into_parts(); // we know the `offset` is relative
198198
// For vtables, get the underlying data allocation.
199199
let alloc_id = match fx.tcx.global_alloc(alloc_id) {
200-
GlobalAlloc::Vtable(ty, trait_ref) => fx.tcx.vtable_allocation((ty, trait_ref)),
200+
GlobalAlloc::VTable(ty, trait_ref) => fx.tcx.vtable_allocation((ty, trait_ref)),
201201
_ => alloc_id,
202202
};
203203
let base_addr = match fx.tcx.global_alloc(alloc_id) {
@@ -221,7 +221,7 @@ pub(crate) fn codegen_const_value<'tcx>(
221221
fx.module.declare_func_in_func(func_id, &mut fx.bcx.func);
222222
fx.bcx.ins().func_addr(fx.pointer_type, local_func_id)
223223
}
224-
GlobalAlloc::Vtable(..) => bug!("vtables are already handled"),
224+
GlobalAlloc::VTable(..) => bug!("vtables are already handled"),
225225
GlobalAlloc::Static(def_id) => {
226226
assert!(fx.tcx.is_static(def_id));
227227
let data_id = data_id_for_static(fx.tcx, fx.module, def_id, false);
@@ -364,7 +364,7 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant
364364
//println!("alloc_id {}", alloc_id);
365365
let alloc = match tcx.global_alloc(alloc_id) {
366366
GlobalAlloc::Memory(alloc) => alloc,
367-
GlobalAlloc::Function(_) | GlobalAlloc::Static(_) | GlobalAlloc::Vtable(..) => {
367+
GlobalAlloc::Function(_) | GlobalAlloc::Static(_) | GlobalAlloc::VTable(..) => {
368368
unreachable!()
369369
}
370370
};
@@ -442,7 +442,7 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant
442442
GlobalAlloc::Memory(target_alloc) => {
443443
data_id_for_alloc_id(cx, module, alloc_id, target_alloc.inner().mutability)
444444
}
445-
GlobalAlloc::Vtable(ty, trait_ref) => {
445+
GlobalAlloc::VTable(ty, trait_ref) => {
446446
let alloc_id = tcx.vtable_allocation((ty, trait_ref));
447447
data_id_for_alloc_id(cx, module, alloc_id, Mutability::Not)
448448
}

0 commit comments

Comments
 (0)