RefTracking, StackPopCleanup,
};
-use tracing::info;
-
const NOTE_ON_UNDEFINED_BEHAVIOR_ERROR: &str = "The rules on what exactly is undefined behavior aren't clear, \
so this check might be overzealous. Please open an issue on the rustc \
repository if you believe it should not be considered undefined behavior.";
body: &'mir mir::Body<'tcx>,
) -> InterpResult<'tcx, MPlaceTy<'tcx>> {
debug!("eval_body_using_ecx: {:?}, {:?}", cid, ecx.param_env);
- info!("HERE body is {:#?}", body);
let tcx = *ecx.tcx;
assert!(
cid.promoted.is_some()
}
}
- #[instrument(skip(ecx), ret)]
fn load_mir(
ecx: &InterpCx<'mir, 'tcx, Self>,
instance: ty::InstanceDef<'tcx>,
// FIXME(#73156): Handle source code coverage in const eval
Coverage(..) => {}
- // FIXME(bryangarza): Update this to do some logic!!!
ConstEvalCounter => {
self.increment_const_eval_counter();
}
#[inline]
pub fn mir_for_ctfe_opt_const_arg(self, def: ty::WithOptConstParam<DefId>) -> &'tcx Body<'tcx> {
- let res = if let Some((did, param_did)) = def.as_const_arg() {
- info!("calling mir_for_ctfe_of_const_arg for DedId {did:?}");
+ if let Some((did, param_did)) = def.as_const_arg() {
self.mir_for_ctfe_of_const_arg((did, param_did))
} else {
- info!("calling mir_for_ctfe for DefId {:?}", def.did);
self.mir_for_ctfe(def.did)
- };
- //info!("RES OF CALLING MIR_FOR_CTFE_OPT_CONST_ARG: {:#?}", res);
- res
+ }
}
}
/// Compute the MIR that is used during CTFE (and thus has no optimizations run on it)
fn mir_for_ctfe(tcx: TyCtxt<'_>, def_id: DefId) -> &Body<'_> {
let did = def_id.expect_local();
- let body = if let Some(def) = ty::WithOptConstParam::try_lookup(did, tcx) {
+ if let Some(def) = ty::WithOptConstParam::try_lookup(did, tcx) {
tcx.mir_for_ctfe_of_const_arg(def)
} else {
tcx.arena.alloc(inner_mir_for_ctfe(tcx, ty::WithOptConstParam::unknown(did)))
- };
- //info!("MIR_FOR_CTFE (DefId = {def_id:?}) body res: {:#?}", body);
- info!("MIR_FOR_CTFE (DefId = {def_id:?})");
- body
+ }
}
/// Same as `mir_for_ctfe`, but used to get the MIR of a const generic parameter.
run_analysis_to_runtime_passes(tcx, &mut body);
- //info!("MIR after runtime passes: {:#?}", body);
tcx.alloc_steal_mir(body)
}
let mut body = remap_mir_for_const_eval_select(tcx, body, hir::Constness::NotConst);
debug!("body: {:#?}", body);
run_optimization_passes(tcx, &mut body);
- //info!("body after OPTIMIZATION: {:#?}", body);
debug_assert!(!body.has_free_regions(), "Free regions in optimized MIR");