diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2020-04-12 04:24:25 +0300 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2020-04-16 19:00:30 +0300 |
| commit | d7c4081b18fbf50f2d260ea893b659aec0b1d84a (patch) | |
| tree | 76d84766b5e8784ad5baa65ad2c5e2e240ae8e9c /src/librustc_codegen_ssa/mir | |
| parent | e22d4795d849d2c6a229ccb666db922ae5b76410 (diff) | |
| download | rust-d7c4081b18fbf50f2d260ea893b659aec0b1d84a.tar.gz rust-d7c4081b18fbf50f2d260ea893b659aec0b1d84a.zip | |
mir/interpret: only use `ErrorHandled::Reported` for `ErrorReported`.
Diffstat (limited to 'src/librustc_codegen_ssa/mir')
| -rw-r--r-- | src/librustc_codegen_ssa/mir/operand.rs | 7 |
1 files changed, 5 insertions, 2 deletions
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. |
