Skip to content

Commit

Permalink
Don't use instantiate_and_normalize_erasing_regions or eval
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Dec 9, 2024
1 parent 3d83340 commit bbdd6ba
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions compiler/rustc_mir_build/src/build/expr/into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,20 +374,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
Some(v) => v.clone(),
None => match variant.fields[n].value {
Some(def) => {
let value =
this.tcx.instantiate_and_normalize_erasing_regions(
args,
this.infcx.typing_env(this.param_env),
Const::from_unevaluated(this.tcx, def),
);
let value = match value.eval(
this.tcx,
this.infcx.typing_env(this.param_env),
expr_span,
) {
Ok(val) => Const::Val(val, value.ty()),
Err(_) => value,
};
let value = Const::from_unevaluated(this.tcx, def)
.instantiate(this.tcx, args);
this.literal_operand(expr_span, value)
}
None => {
Expand Down

0 comments on commit bbdd6ba

Please sign in to comment.