Keep an unoptimized duplicate of const fn
around
This allows CTFE to reliably detect UB, as otherwise optimizations may hide UB.
This commit is contained in:
parent
8e4fe6647f
commit
cccd40f9b5
25 changed files with 312 additions and 112 deletions
|
@ -152,7 +152,7 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
|
|||
if concrete.is_ok() && substs.has_param_types_or_consts() {
|
||||
match infcx.tcx.def_kind(def.did) {
|
||||
DefKind::AnonConst => {
|
||||
let mir_body = infcx.tcx.optimized_mir_opt_const_arg(def);
|
||||
let mir_body = infcx.tcx.mir_for_ctfe_opt_const_arg(def);
|
||||
|
||||
if mir_body.is_polymorphic {
|
||||
future_compat_lint();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue