Auto merge of #102056 - b-naber:unevaluated, r=lcnr

Introduce mir::Unevaluated

Previously the distinction between unevaluated constants in the type-system and in mir was not explicit and a little confusing. Probably better to introduce its own type for that.

r? `@lcnr`
This commit is contained in:
bors 2022-09-23 13:39:11 +00:00
commit d9277c6aa8
2 changed files with 2 additions and 2 deletions

View File

@ -195,7 +195,7 @@ fn is_value_unfrozen_expr<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId, def_id: D
let result = cx.tcx.const_eval_resolve(
cx.param_env,
ty::Unevaluated::new(ty::WithOptConstParam::unknown(def_id), substs),
mir::UnevaluatedConst::new(ty::WithOptConstParam::unknown(def_id), substs),
None,
);
is_value_unfrozen_raw(cx, result, ty)

View File

@ -424,7 +424,7 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> {
.tcx
.const_eval_resolve(
self.param_env,
ty::Unevaluated::new(ty::WithOptConstParam::unknown(def_id), substs),
mir::UnevaluatedConst::new(ty::WithOptConstParam::unknown(def_id), substs),
None,
)
.ok()