From d7c4081b18fbf50f2d260ea893b659aec0b1d84a Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Sun, 12 Apr 2020 04:24:25 +0300 Subject: mir/interpret: only use `ErrorHandled::Reported` for `ErrorReported`. --- src/librustc_codegen_ssa/mir/operand.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/librustc_codegen_ssa') diff --git a/src/librustc_codegen_ssa/mir/operand.rs b/src/librustc_codegen_ssa/mir/operand.rs index 69f11ed57ac..7d0e6998db4 100644 --- a/src/librustc_codegen_ssa/mir/operand.rs +++ b/src/librustc_codegen_ssa/mir/operand.rs @@ -6,6 +6,7 @@ use crate::glue; use crate::traits::*; use crate::MemFlags; +use rustc_errors::ErrorReported; use rustc_middle::mir; use rustc_middle::mir::interpret::{ConstValue, ErrorHandled, Pointer, Scalar}; use rustc_middle::ty::layout::TyAndLayout; @@ -447,8 +448,10 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { self.eval_mir_constant_to_operand(bx, constant).unwrap_or_else(|err| { match err { // errored or at least linted - ErrorHandled::Reported => {} - ErrorHandled::TooGeneric => bug!("codgen encountered polymorphic constant"), + ErrorHandled::Reported(ErrorReported) | ErrorHandled::Linted => {} + ErrorHandled::TooGeneric => { + bug!("codegen encountered polymorphic constant") + } } // Allow RalfJ to sleep soundly knowing that even refactorings that remove // the above error (or silence it under some conditions) will not cause UB. -- cgit 1.4.1-3-g733a5