Skip to content

Commit bbdd6ba

Browse files
committed
Don't use instantiate_and_normalize_erasing_regions or eval
1 parent 3d83340 commit bbdd6ba

File tree

1 file changed

+2
-14
lines changed
  • compiler/rustc_mir_build/src/build/expr

1 file changed

+2
-14
lines changed

compiler/rustc_mir_build/src/build/expr/into.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -374,20 +374,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
374374
Some(v) => v.clone(),
375375
None => match variant.fields[n].value {
376376
Some(def) => {
377-
let value =
378-
this.tcx.instantiate_and_normalize_erasing_regions(
379-
args,
380-
this.infcx.typing_env(this.param_env),
381-
Const::from_unevaluated(this.tcx, def),
382-
);
383-
let value = match value.eval(
384-
this.tcx,
385-
this.infcx.typing_env(this.param_env),
386-
expr_span,
387-
) {
388-
Ok(val) => Const::Val(val, value.ty()),
389-
Err(_) => value,
390-
};
377+
let value = Const::from_unevaluated(this.tcx, def)
378+
.instantiate(this.tcx, args);
391379
this.literal_operand(expr_span, value)
392380
}
393381
None => {

0 commit comments

Comments
 (0)