various nits from review
This commit is contained in:
parent
9cbd1066d7
commit
0318f07bdd
5 changed files with 6 additions and 8 deletions
|
@ -369,7 +369,6 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant
|
|||
while let Some(todo_item) = cx.todo.pop() {
|
||||
let (data_id, alloc, section_name) = match todo_item {
|
||||
TodoItem::Alloc(alloc_id) => {
|
||||
//println!("alloc_id {}", alloc_id);
|
||||
let alloc = match tcx.global_alloc(alloc_id) {
|
||||
GlobalAlloc::Memory(alloc) => alloc,
|
||||
GlobalAlloc::Function(_) | GlobalAlloc::Static(_) | GlobalAlloc::VTable(..) => {
|
||||
|
|
|
@ -9,7 +9,10 @@ use crate::MemFlags;
|
|||
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt};
|
||||
use rustc_span::{sym, Span};
|
||||
use rustc_target::abi::{WrappingRange, call::{FnAbi, PassMode}};
|
||||
use rustc_target::abi::{
|
||||
call::{FnAbi, PassMode},
|
||||
WrappingRange,
|
||||
};
|
||||
|
||||
fn copy_intrinsic<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx: &mut Bx,
|
||||
|
|
|
@ -366,7 +366,7 @@ impl<'s> AllocDecodingSession<'s> {
|
|||
}
|
||||
AllocDiscriminant::VTable => {
|
||||
assert!(alloc_id.is_none());
|
||||
trace!("creating static alloc ID");
|
||||
trace!("creating vtable alloc ID");
|
||||
let ty = <Ty<'_> as Decodable<D>>::decode(decoder);
|
||||
let poly_trait_ref =
|
||||
<Option<ty::PolyExistentialTraitRef<'_>> as Decodable<D>>::decode(decoder);
|
||||
|
|
|
@ -1428,9 +1428,6 @@ fn collect_miri<'tcx>(tcx: TyCtxt<'tcx>, alloc_id: AllocId, output: &mut MonoIte
|
|||
}
|
||||
}
|
||||
GlobalAlloc::VTable(ty, trait_ref) => {
|
||||
// FIXME(RJ) no ideas if this is correct. There is this nice
|
||||
// `create_mono_items_for_vtable_methods` method but I wouldn't know how to call it from
|
||||
// here. So instead we just generate the actual vtable and recurse.
|
||||
let alloc_id = tcx.vtable_allocation((ty, trait_ref));
|
||||
collect_miri(tcx, alloc_id, output)
|
||||
}
|
||||
|
|
|
@ -185,8 +185,7 @@ extern "C" {
|
|||
/// Opaque type for accessing vtables.
|
||||
///
|
||||
/// Private implementation detail of `DynMetadata::size_of` etc.
|
||||
/// Must be zero-sized since there is conceptually not actually any Abstract Machine memory behind this pointer.
|
||||
/// However, we can require pointer alignment.
|
||||
/// There is conceptually not actually any Abstract Machine memory behind this pointer.
|
||||
type VTable;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue