about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/lib.rs
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2023-07-25 19:37:45 +0200
committerUrgau <urgau@numericable.fr>2023-09-04 13:54:20 +0200
commiteba5b447298c00f07f11540eef2d003cc207f9d1 (patch)
tree67b8c9b78d5d81a4475ab352a5a88d68a0db6d0b /compiler/rustc_errors/src/lib.rs
parentbf1e3f31f95c0f75b9bf51a58e8684f750f919f2 (diff)
downloadrust-eba5b447298c00f07f11540eef2d003cc207f9d1.tar.gz
rust-eba5b447298c00f07f11540eef2d003cc207f9d1.zip
Add OnceHelp lint level (same as OnceNote, except for help)
Diffstat (limited to 'compiler/rustc_errors/src/lib.rs')
-rw-r--r--compiler/rustc_errors/src/lib.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index 9bb1a6a2b14..55c4ec66cd9 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -1390,7 +1390,7 @@ impl HandlerInner {
                 debug!(?self.emitted_diagnostics);
                 let already_emitted_sub = |sub: &mut SubDiagnostic| {
                     debug!(?sub);
-                    if sub.level != Level::OnceNote {
+                    if sub.level != Level::OnceNote && sub.level != Level::OnceHelp {
                         return false;
                     }
                     let mut hasher = StableHasher::new();
@@ -1792,6 +1792,8 @@ pub enum Level {
     /// A note that is only emitted once.
     OnceNote,
     Help,
+    /// A help that is only emitted once.
+    OnceHelp,
     FailureNote,
     Allow,
     Expect(LintExpectationId),
@@ -1816,7 +1818,7 @@ impl Level {
             Note | OnceNote => {
                 spec.set_fg(Some(Color::Green)).set_intense(true);
             }
-            Help => {
+            Help | OnceHelp => {
                 spec.set_fg(Some(Color::Cyan)).set_intense(true);
             }
             FailureNote => {}
@@ -1831,7 +1833,7 @@ impl Level {
             Fatal | Error { .. } => "error",
             Warning(_) => "warning",
             Note | OnceNote => "note",
-            Help => "help",
+            Help | OnceHelp => "help",
             FailureNote => "failure-note",
             Allow => panic!("Shouldn't call on allowed error"),
             Expect(_) => panic!("Shouldn't call on expected error"),