Skip to content

Commit f97908d

Browse files
committed
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.
1 parent 43399d6 commit f97908d

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ pub fn report_error<'tcx, 'mir>(
289289
(None, format!("see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information")),
290290
],
291291
InvalidProgram(
292-
InvalidProgramInfo::AlreadyReported(rustc_errors::ErrorGuaranteed { .. })
292+
InvalidProgramInfo::AlreadyReported(_)
293293
) => {
294294
// This got already reported. No point in reporting it again.
295295
return None;

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ extern crate rustc_ast;
4747
extern crate rustc_middle;
4848
extern crate rustc_const_eval;
4949
extern crate rustc_data_structures;
50-
extern crate rustc_errors;
5150
extern crate rustc_hir;
5251
extern crate rustc_index;
5352
extern crate rustc_session;

0 commit comments

Comments
 (0)