Rollup merge of #83040 - lcnr:unused-ct-substs, r=oli-obk

extract `ConstKind::Unevaluated` into a struct

r? `@oli-obk`
This commit is contained in:
Dylan DPC
2021-03-21 02:01:36 +01:00
committed by GitHub
50 changed files with 200 additions and 167 deletions

View File

@@ -558,13 +558,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
debug!(?c1, ?c2, "evaluate_predicate_recursively: equating consts");
let evaluate = |c: &'tcx ty::Const<'tcx>| {
if let ty::ConstKind::Unevaluated(def, substs, promoted) = c.val {
if let ty::ConstKind::Unevaluated(unevaluated) = c.val {
self.infcx
.const_eval_resolve(
obligation.param_env,
def,
substs,
promoted,
unevaluated,
Some(obligation.cause.span),
)
.map(|val| ty::Const::from_value(self.tcx(), val, c.ty))