diff --git a/compiler/rustc_mir_build/src/build/expr/into.rs b/compiler/rustc_mir_build/src/build/expr/into.rs index b4c0889e6ba3..23e4ba51b13c 100644 --- a/compiler/rustc_mir_build/src/build/expr/into.rs +++ b/compiler/rustc_mir_build/src/build/expr/into.rs @@ -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 => {