Skip to content

Commit d626890

Browse files
committed
Address review comments
1 parent b7c54f3 commit d626890

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

compiler/rustc_const_eval/src/interpret/stack.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,9 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
386386

387387
// Make sure all the constants required by this frame evaluate successfully (post-monomorphization check).
388388
for &const_ in body.required_consts() {
389-
let _trace = enter_trace_span!(M, const_eval::push_stack_frame_raw, ?const_.const_);
389+
// We can't use `eval_mir_constant` here as that assumes that all required consts have
390+
// already been checked, so we need a separate tracing call.
391+
let _trace = enter_trace_span!(M, const_eval::required_consts, ?const_.const_);
390392
let c =
391393
self.instantiate_from_current_frame_and_normalize_erasing_regions(const_.const_)?;
392394
c.eval(*self.tcx, self.typing_env, const_.span).map_err(|err| {

src/tools/miri/src/machine.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,10 +1109,9 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
11091109
ret: Option<mir::BasicBlock>,
11101110
unwind: mir::UnwindAction,
11111111
) -> InterpResult<'tcx, Option<(&'tcx mir::Body<'tcx>, ty::Instance<'tcx>)>> {
1112-
let _trace = enter_trace_span!("find_mir_or_eval_fn");
1113-
11141112
// For foreign items, try to see if we can emulate them.
11151113
if ecx.tcx.is_foreign_item(instance.def_id()) {
1114+
let _trace = enter_trace_span!("emulate_foreign_item");
11161115
// An external function call that does not have a MIR body. We either find MIR elsewhere
11171116
// or emulate its effect.
11181117
// This will be Ok(None) if we're emulating the intrinsic entirely within Miri (no need
@@ -1125,6 +1124,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
11251124
}
11261125

11271126
// Otherwise, load the MIR.
1127+
let _trace = enter_trace_span!("load_mir");
11281128
interp_ok(Some((ecx.load_mir(instance.def, None)?, instance)))
11291129
}
11301130

0 commit comments

Comments
 (0)