From f97908d06a991deba335868cf6e8fac62e91a0c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Mon, 15 May 2023 00:00:00 +0000 Subject: [PATCH] Suppress "erroneous constant used" for constants tainted by errors When constant evaluation fails because its MIR is tainted by errors, suppress note indicating that erroneous constant was used, since those errors have to be fixed regardless of the constant being used or not. --- src/diagnostics.rs | 2 +- src/lib.rs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/diagnostics.rs b/src/diagnostics.rs index a93f3eb84f..e3f81a78ee 100644 --- a/src/diagnostics.rs +++ b/src/diagnostics.rs @@ -289,7 +289,7 @@ pub fn report_error<'tcx, 'mir>( (None, format!("see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information")), ], InvalidProgram( - InvalidProgramInfo::AlreadyReported(rustc_errors::ErrorGuaranteed { .. }) + InvalidProgramInfo::AlreadyReported(_) ) => { // This got already reported. No point in reporting it again. return None; diff --git a/src/lib.rs b/src/lib.rs index fc938080a0..893a4dbd4c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -47,7 +47,6 @@ extern crate rustc_ast; extern crate rustc_middle; extern crate rustc_const_eval; extern crate rustc_data_structures; -extern crate rustc_errors; extern crate rustc_hir; extern crate rustc_index; extern crate rustc_session;