From ed8ee39930a1bc0b436a67b7189b79466a514bae Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 7 Dec 2024 17:22:09 +0100 Subject: fix ICE on type error in promoted --- compiler/rustc_const_eval/src/interpret/eval_context.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_const_eval/src/interpret') diff --git a/compiler/rustc_const_eval/src/interpret/eval_context.rs b/compiler/rustc_const_eval/src/interpret/eval_context.rs index 241be5e175c..95a72d3cbc1 100644 --- a/compiler/rustc_const_eval/src/interpret/eval_context.rs +++ b/compiler/rustc_const_eval/src/interpret/eval_context.rs @@ -268,7 +268,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { }; // do not continue if typeck errors occurred (can only occur in local crate) if let Some(err) = body.tainted_by_errors { - throw_inval!(AlreadyReported(ReportedErrorInfo::from(err))); + throw_inval!(AlreadyReported(ReportedErrorInfo::non_const_eval_error(err))); } interp_ok(body) } @@ -317,7 +317,9 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { Ok(None) => throw_inval!(TooGeneric), // FIXME(eddyb) this could be a bit more specific than `AlreadyReported`. - Err(error_reported) => throw_inval!(AlreadyReported(error_reported.into())), + Err(error_guaranteed) => throw_inval!(AlreadyReported( + ReportedErrorInfo::non_const_eval_error(error_guaranteed) + )), } } -- cgit 1.4.1-3-g733a5