File tree 1 file changed +4
-6
lines changed
compiler/rustc_middle/src/ty/consts
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> {
217
217
// Note that we erase regions *before* calling `with_reveal_all_normalized`,
218
218
// so that we don't try to invoke this query with
219
219
// 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) ) ;
224
220
225
221
// HACK(eddyb) when the query key would contain inference variables,
226
222
// attempt using identity substs and `ParamEnv` instead, that will succeed
227
223
// when the expression doesn't depend on any parameters.
228
224
// FIXME(eddyb, skinny121) pass `InferCtxt` into here when it's available, so that
229
225
// 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 ( ) {
231
227
tcx. param_env ( unevaluated. def . did ) . and ( ty:: UnevaluatedConst {
232
228
def : unevaluated. def ,
233
229
substs : InternalSubsts :: identity_for_item ( tcx, unevaluated. def . did ) ,
234
230
} )
235
231
} else {
236
- param_env_and
232
+ tcx. erase_regions ( param_env)
233
+ . with_reveal_all_normalized ( tcx)
234
+ . and ( tcx. erase_regions ( unevaluated) )
237
235
} ;
238
236
239
237
// FIXME(eddyb) maybe the `const_eval_*` methods should take
You can’t perform that action at this time.
0 commit comments