We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
#[must_use]
1 parent 5c25ff5 commit a4ea4beCopy full SHA for a4ea4be
compiler/rustc_macros/src/diagnostics/utils.rs
@@ -619,6 +619,12 @@ impl SubdiagnosticVariant {
619
let name = attr.path().segments.last().unwrap().ident.to_string();
620
let name = name.as_str();
621
622
+ // We want diagnostic structs to be marked `#[must_use]`, so we must
623
+ // allow it as a no-op attr here.
624
+ if name == "must_use" {
625
+ return Ok(None);
626
+ }
627
+
628
let mut kind = match name {
629
"label" => SubdiagnosticKind::Label,
630
"note" => SubdiagnosticKind::Note,
0 commit comments