about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/const_eval/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_mir/src/const_eval/error.rs')
-rw-r--r--compiler/rustc_mir/src/const_eval/error.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/compiler/rustc_mir/src/const_eval/error.rs b/compiler/rustc_mir/src/const_eval/error.rs
index fc21047ab72..17e8ab2a4da 100644
--- a/compiler/rustc_mir/src/const_eval/error.rs
+++ b/compiler/rustc_mir/src/const_eval/error.rs
@@ -157,7 +157,7 @@ impl<'tcx> ConstEvalErr<'tcx> {
         tcx: TyCtxtAt<'tcx>,
         message: &str,
         emit: impl FnOnce(DiagnosticBuilder<'_>),
-        mut lint_root: Option<hir::HirId>,
+        lint_root: Option<hir::HirId>,
     ) -> ErrorHandled {
         let finish = |mut err: DiagnosticBuilder<'_>, span_msg: Option<String>| {
             trace!("reporting const eval failure at {:?}", self.span);
@@ -194,12 +194,6 @@ impl<'tcx> ConstEvalErr<'tcx> {
             _ => {}
         };
 
-        // If we have a 'hard error', then set `lint_root` to `None` so that we don't
-        // emit a lint.
-        if matches!(&self.error, InterpError::MachineStop(err) if err.is_hard_err()) {
-            lint_root = None;
-        }
-
         let err_msg = self.error.to_string();
 
         // Regular case - emit a lint.