Skip to content

Commit 0bd6df9

Browse files
committed
Add MemoryExtra to find_foreign_static
1 parent 7e0afda commit 0bd6df9

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/librustc_mir/const_eval.rs

+1
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
410410
}
411411

412412
fn find_foreign_static(
413+
_memory_extra: &Self::MemoryExtra,
413414
_tcx: TyCtxt<'tcx>,
414415
_def_id: DefId,
415416
) -> InterpResult<'tcx, Cow<'tcx, Allocation<Self::PointerTag>>> {

src/librustc_mir/interpret/machine.rs

+1
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ pub trait Machine<'mir, 'tcx>: Sized {
164164
///
165165
/// This allocation will then be fed to `tag_allocation` to initialize the "extra" state.
166166
fn find_foreign_static(
167+
memory_extra: &Self::MemoryExtra,
167168
tcx: TyCtxt<'tcx>,
168169
def_id: DefId,
169170
) -> InterpResult<'tcx, Cow<'tcx, Allocation>>;

src/librustc_mir/interpret/memory.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
437437
// We got a "lazy" static that has not been computed yet.
438438
if tcx.is_foreign_item(def_id) {
439439
trace!("static_alloc: foreign item {:?}", def_id);
440-
M::find_foreign_static(tcx.tcx, def_id)?
440+
M::find_foreign_static(memory_extra, tcx.tcx, def_id)?
441441
} else {
442442
trace!("static_alloc: Need to compute {:?}", def_id);
443443
let instance = Instance::mono(tcx.tcx, def_id);

0 commit comments

Comments
 (0)