macros: tidy up lint changes
Small tweaks to changes made in a previous PR, unrelated to eager translation. Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
691aeaad6c
commit
febbf71219
1 changed files with 6 additions and 3 deletions
|
@ -105,8 +105,8 @@ impl<'a> LintDiagnosticDerive<'a> {
|
||||||
});
|
});
|
||||||
|
|
||||||
let msg = builder.each_variant(&mut structure, |mut builder, variant| {
|
let msg = builder.each_variant(&mut structure, |mut builder, variant| {
|
||||||
// HACK(wafflelapkin): initialize slug (???)
|
// Collect the slug by generating the preamble.
|
||||||
let _preamble = builder.preamble(&variant);
|
let _ = builder.preamble(&variant);
|
||||||
|
|
||||||
match builder.slug.value_ref() {
|
match builder.slug.value_ref() {
|
||||||
None => {
|
None => {
|
||||||
|
@ -125,7 +125,10 @@ impl<'a> LintDiagnosticDerive<'a> {
|
||||||
let diag = &builder.diag;
|
let diag = &builder.diag;
|
||||||
structure.gen_impl(quote! {
|
structure.gen_impl(quote! {
|
||||||
gen impl<'__a> rustc_errors::DecorateLint<'__a, ()> for @Self {
|
gen impl<'__a> rustc_errors::DecorateLint<'__a, ()> for @Self {
|
||||||
fn decorate_lint<'__b>(self, #diag: &'__b mut rustc_errors::DiagnosticBuilder<'__a, ()>) -> &'__b mut rustc_errors::DiagnosticBuilder<'__a, ()> {
|
fn decorate_lint<'__b>(
|
||||||
|
self,
|
||||||
|
#diag: &'__b mut rustc_errors::DiagnosticBuilder<'__a, ()>
|
||||||
|
) -> &'__b mut rustc_errors::DiagnosticBuilder<'__a, ()> {
|
||||||
use rustc_errors::IntoDiagnosticArg;
|
use rustc_errors::IntoDiagnosticArg;
|
||||||
#implementation
|
#implementation
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue