]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_infer/traits/fulfill.rs
Update const_forget.rs
[rust.git] / src / librustc_infer / traits / fulfill.rs
index 6055b0e74df54c8a255a32c13393bdcb9911c9c6..28d3f26918019d9b97744cbe393bb90ca5165d25 100644 (file)
@@ -510,27 +510,15 @@ fn infer_ty(ty: Ty<'tcx>) -> ty::InferTy {
             }
 
             ty::Predicate::ConstEvaluatable(def_id, substs) => {
-                if obligation.param_env.has_local_value() {
-                    ProcessResult::Unchanged
-                } else {
-                    if !substs.has_local_value() {
-                        match self.selcx.tcx().const_eval_resolve(
-                            obligation.param_env,
-                            def_id,
-                            substs,
-                            None,
-                            Some(obligation.cause.span),
-                        ) {
-                            Ok(_) => ProcessResult::Changed(vec![]),
-                            Err(err) => {
-                                ProcessResult::Error(CodeSelectionError(ConstEvalFailure(err)))
-                            }
-                        }
-                    } else {
-                        pending_obligation.stalled_on =
-                            substs.types().map(|ty| infer_ty(ty)).collect();
-                        ProcessResult::Unchanged
-                    }
+                match self.selcx.infcx().const_eval_resolve(
+                    obligation.param_env,
+                    def_id,
+                    substs,
+                    None,
+                    Some(obligation.cause.span),
+                ) {
+                    Ok(_) => ProcessResult::Changed(vec![]),
+                    Err(err) => ProcessResult::Error(CodeSelectionError(ConstEvalFailure(err))),
                 }
             }
         }