Skip to content

Commit e8c3cbf

Browse files
committed
Make Diagnostic::is_error return false for Level::FailureNote.
It doesn't affect behaviour, but makes sense with (a) `FailureNote` having `()` as its emission guarantee, and (b) in `Level` the `is_error` levels now are all listed before the non-`is_error` levels.
1 parent 4e3eed4 commit e8c3cbf

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

compiler/rustc_errors/src/diagnostic.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,7 @@ impl Diagnostic {
238238
Level::Bug
239239
| Level::DelayedBug(DelayedBugKind::Normal)
240240
| Level::Fatal
241-
| Level::Error
242-
| Level::FailureNote => true,
241+
| Level::Error => true,
243242

244243
Level::ForceWarning(_)
245244
| Level::Warning
@@ -248,6 +247,7 @@ impl Diagnostic {
248247
| Level::OnceNote
249248
| Level::Help
250249
| Level::OnceHelp
250+
| Level::FailureNote
251251
| Level::Allow
252252
| Level::Expect(_) => false,
253253
}

compiler/rustc_errors/src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1541,6 +1541,8 @@ pub enum Level {
15411541
///
15421542
/// The [`LintExpectationId`] is used for expected lint diagnostics. In all other cases this
15431543
/// should be `None`.
1544+
///
1545+
/// Its `EmissionGuarantee` is `()`.
15441546
ForceWarning(Option<LintExpectationId>),
15451547

15461548
/// A warning about the code being compiled. Does not prevent compilation from finishing.
@@ -1570,7 +1572,8 @@ pub enum Level {
15701572
/// Its `EmissionGuarantee` is `()`.
15711573
OnceHelp,
15721574

1573-
/// Similar to `Note`, but used in cases where compilation has failed. Rare.
1575+
/// Similar to `Note`, but used in cases where compilation has failed. When printed for human
1576+
/// consumption, it doesn't have any kind of `note:` label. Rare.
15741577
///
15751578
/// Its `EmissionGuarantee` is `()`.
15761579
FailureNote,

0 commit comments

Comments
 (0)