From bbdd6bacd09dcc102deee59daa4efd581e050bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Fri, 6 Dec 2024 20:38:35 +0000 Subject: [PATCH] Don't use `instantiate_and_normalize_erasing_regions` or `eval` --- compiler/rustc_mir_build/src/build/expr/into.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) 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 => {