File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
compiler/rustc_middle/src/ty/consts Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -217,23 +217,21 @@ impl<'tcx> ConstKind<'tcx> {
217217 // Note that we erase regions *before* calling `with_reveal_all_normalized`,
218218 // so that we don't try to invoke this query with
219219 // any region variables.
220- let param_env_and = tcx
221- . erase_regions ( param_env)
222- . with_reveal_all_normalized ( tcx)
223- . and ( tcx. erase_regions ( unevaluated) ) ;
224220
225221 // HACK(eddyb) when the query key would contain inference variables,
226222 // attempt using identity substs and `ParamEnv` instead, that will succeed
227223 // when the expression doesn't depend on any parameters.
228224 // FIXME(eddyb, skinny121) pass `InferCtxt` into here when it's available, so that
229225 // we can call `infcx.const_eval_resolve` which handles inference variables.
230- let param_env_and = if param_env_and . needs_infer ( ) {
226+ let param_env_and = if ( param_env , unevaluated ) . has_non_region_infer ( ) {
231227 tcx. param_env ( unevaluated. def . did ) . and ( ty:: UnevaluatedConst {
232228 def : unevaluated. def ,
233229 substs : InternalSubsts :: identity_for_item ( tcx, unevaluated. def . did ) ,
234230 } )
235231 } else {
236- param_env_and
232+ tcx. erase_regions ( param_env)
233+ . with_reveal_all_normalized ( tcx)
234+ . and ( tcx. erase_regions ( unevaluated) )
237235 } ;
238236
239237 // FIXME(eddyb) maybe the `const_eval_*` methods should take
You can’t perform that action at this time.
0 commit comments