diff options
| author | bors <bors@rust-lang.org> | 2020-02-28 06:14:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-02-28 06:14:52 +0000 |
| commit | bfc32dd106f0fe191b8bcd9b76348a8875c30a60 (patch) | |
| tree | f61b69b4967e3cc831545668768cee807cf10d50 /src/librustc_mir | |
| parent | 7497d93ef17d2b87fa8efb5c5de33f0bdc4155af (diff) | |
| parent | ebfa2f448efcce8f8121b883ee876653fc098261 (diff) | |
| download | rust-bfc32dd106f0fe191b8bcd9b76348a8875c30a60.tar.gz rust-bfc32dd106f0fe191b8bcd9b76348a8875c30a60.zip | |
Auto merge of #68505 - skinny121:canonicalize-const-eval-inputs, r=nikomatsakis
Canonicalize inputs to const eval where needed Canonicalize inputs to const eval, so that they can contain inference variables. Which enables invoking const eval queries even if the current param env has inference variable within it, which can occur during trait selection. This is a reattempt of #67717, in a far less invasive way. Fixes #68477 r? @nikomatsakis cc @eddyb
Diffstat (limited to 'src/librustc_mir')
| -rw-r--r-- | src/librustc_mir/interpret/eval_context.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/librustc_mir/interpret/eval_context.rs b/src/librustc_mir/interpret/eval_context.rs index fc4ba4d6cd9..cce4b90e224 100644 --- a/src/librustc_mir/interpret/eval_context.rs +++ b/src/librustc_mir/interpret/eval_context.rs @@ -768,11 +768,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { } else { self.param_env }; - let val = if let Some(promoted) = gid.promoted { - self.tcx.const_eval_promoted(param_env, gid.instance, promoted)? - } else { - self.tcx.const_eval_instance(param_env, gid.instance, Some(self.tcx.span))? - }; + let val = self.tcx.const_eval_global_id(param_env, gid, Some(self.tcx.span))?; // Even though `ecx.const_eval` is called from `eval_const_to_op` we can never have a // recursion deeper than one level, because the `tcx.const_eval` above is guaranteed to not |
