Skip to content

Commit febbf71

Browse files
committed
macros: tidy up lint changes
Small tweaks to changes made in a previous PR, unrelated to eager translation. Signed-off-by: David Wood <[email protected]>
1 parent 691aeaa commit febbf71

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

compiler/rustc_macros/src/diagnostics/diagnostic.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ impl<'a> LintDiagnosticDerive<'a> {
105105
});
106106

107107
let msg = builder.each_variant(&mut structure, |mut builder, variant| {
108-
// HACK(wafflelapkin): initialize slug (???)
109-
let _preamble = builder.preamble(&variant);
108+
// Collect the slug by generating the preamble.
109+
let _ = builder.preamble(&variant);
110110

111111
match builder.slug.value_ref() {
112112
None => {
@@ -125,7 +125,10 @@ impl<'a> LintDiagnosticDerive<'a> {
125125
let diag = &builder.diag;
126126
structure.gen_impl(quote! {
127127
gen impl<'__a> rustc_errors::DecorateLint<'__a, ()> for @Self {
128-
fn decorate_lint<'__b>(self, #diag: &'__b mut rustc_errors::DiagnosticBuilder<'__a, ()>) -> &'__b mut rustc_errors::DiagnosticBuilder<'__a, ()> {
128+
fn decorate_lint<'__b>(
129+
self,
130+
#diag: &'__b mut rustc_errors::DiagnosticBuilder<'__a, ()>
131+
) -> &'__b mut rustc_errors::DiagnosticBuilder<'__a, ()> {
129132
use rustc_errors::IntoDiagnosticArg;
130133
#implementation
131134
}

0 commit comments

Comments
 (0)