Skip to content

Commit f9e2a6b

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 f3d71c9 commit f9e2a6b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

compiler/rustc_errors/src/diagnostic.rs

Lines changed: 2 additions & 2 deletions
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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1545,6 +1545,8 @@ pub enum Level {
15451545
///
15461546
/// The [`LintExpectationId`] is used for expected lint diagnostics. In all other cases this
15471547
/// should be `None`.
1548+
///
1549+
/// Its `EmissionGuarantee` is `()`.
15481550
ForceWarning(Option<LintExpectationId>),
15491551

15501552
/// A warning about the code being compiled. Does not prevent compilation from finishing.
@@ -1574,7 +1576,8 @@ pub enum Level {
15741576
/// Its `EmissionGuarantee` is `()`.
15751577
OnceHelp,
15761578

1577-
/// Similar to `Note`, but used in cases where compilation has failed. Rare.
1579+
/// Similar to `Note`, but used in cases where compilation has failed. When printed for human
1580+
/// consumption, it doesn't have any kind of `note:` label. Rare.
15781581
///
15791582
/// Its `EmissionGuarantee` is `()`.
15801583
FailureNote,

0 commit comments

Comments
 (0)