diff options
| author | lcnr <rust@lcnr.de> | 2021-03-13 16:31:38 +0100 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2021-03-20 17:22:24 +0100 |
| commit | 7c9b5b4ce03c84f4c48ca39c96ff7ff20df0daad (patch) | |
| tree | 2c83d63981b6eeb7d592badb577c18d8a98205ca /compiler/rustc_infer/src/infer | |
| parent | 43ebac119b853de626fcc9afb49c5b0544731141 (diff) | |
| download | rust-7c9b5b4ce03c84f4c48ca39c96ff7ff20df0daad.tar.gz rust-7c9b5b4ce03c84f4c48ca39c96ff7ff20df0daad.zip | |
update `const_eval_resolve`
Diffstat (limited to 'compiler/rustc_infer/src/infer')
| -rw-r--r-- | compiler/rustc_infer/src/infer/mod.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs index 3df58cb7857..7b18f4d0ff6 100644 --- a/compiler/rustc_infer/src/infer/mod.rs +++ b/compiler/rustc_infer/src/infer/mod.rs @@ -18,7 +18,6 @@ use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_middle::infer::canonical::{Canonical, CanonicalVarValues}; use rustc_middle::infer::unify_key::{ConstVarValue, ConstVariableValue}; use rustc_middle::infer::unify_key::{ConstVariableOrigin, ConstVariableOriginKind, ToType}; -use rustc_middle::mir; use rustc_middle::mir::interpret::EvalToConstValueResult; use rustc_middle::traits::select; use rustc_middle::ty::error::{ExpectedFound, TypeError, UnconstrainedNumeric}; @@ -1499,9 +1498,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { pub fn const_eval_resolve( &self, param_env: ty::ParamEnv<'tcx>, - def: ty::WithOptConstParam<DefId>, - substs: SubstsRef<'tcx>, - promoted: Option<mir::Promoted>, + ty::Unevaluated { def, substs, promoted }: ty::Unevaluated<'tcx>, span: Option<Span>, ) -> EvalToConstValueResult<'tcx> { let mut original_values = OriginalQueryValues::default(); @@ -1510,7 +1507,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { let (param_env, substs) = canonical.value; // The return value is the evaluated value which doesn't contain any reference to inference // variables, thus we don't need to substitute back the original values. - self.tcx.const_eval_resolve(param_env, def, substs, promoted, span) + self.tcx.const_eval_resolve(param_env, ty::Unevaluated { def, substs, promoted }, span) } /// If `typ` is a type variable of some kind, resolve it one level |
