Rollup merge of #116277 - RalfJung:post-mono, r=oli-obk
dont call mir.post_mono_checks in codegen It seems like all tests are still passing when I remove this... let's see what CI says.
This commit is contained in:
commit
6d1c3a40cb
11 changed files with 32 additions and 81 deletions
|
@ -21,6 +21,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
}
|
||||
|
||||
pub fn eval_mir_constant(&self, constant: &mir::ConstOperand<'tcx>) -> mir::ConstValue<'tcx> {
|
||||
// `MirUsedCollector` visited all constants before codegen began, so if we got here there
|
||||
// can be no more constants that fail to evaluate.
|
||||
self.monomorphize(constant.const_)
|
||||
.eval(self.cx.tcx(), ty::ParamEnv::reveal_all(), Some(constant.span))
|
||||
.expect("erroneous constant not captured by required_consts")
|
||||
|
|
|
@ -209,18 +209,11 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
|||
caller_location: None,
|
||||
};
|
||||
|
||||
fx.per_local_var_debug_info = fx.compute_per_local_var_debug_info(&mut start_bx);
|
||||
// It may seem like we should iterate over `required_consts` to ensure they all successfully
|
||||
// evaluate; however, the `MirUsedCollector` already did that during the collection phase of
|
||||
// monomorphization so we don't have to do it again.
|
||||
|
||||
// Rust post-monomorphization checks; we later rely on them.
|
||||
if let Err(err) =
|
||||
mir.post_mono_checks(cx.tcx(), ty::ParamEnv::reveal_all(), |c| Ok(fx.monomorphize(c)))
|
||||
{
|
||||
err.emit_err(cx.tcx());
|
||||
// This IR shouldn't ever be emitted, but let's try to guard against any of this code
|
||||
// ever running.
|
||||
start_bx.abort();
|
||||
return;
|
||||
}
|
||||
fx.per_local_var_debug_info = fx.compute_per_local_var_debug_info(&mut start_bx);
|
||||
|
||||
let memory_locals = analyze::non_ssa_locals(&fx);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue