1
Fork 0

Shorten Span of unused macro lints

The span has been recuded to the actual ident, instead of linting the
*whole* macro.
This commit is contained in:
Marcel Hellwig 2021-11-10 12:00:46 +01:00
parent 9dbbbb12c0
commit 9f6ca7482c
7 changed files with 41 additions and 62 deletions

View file

@ -315,8 +315,13 @@ impl<'a> ResolverExpand for Resolver<'a> {
}
fn check_unused_macros(&mut self) {
for (_, &(node_id, span)) in self.unused_macros.iter() {
self.lint_buffer.buffer_lint(UNUSED_MACROS, node_id, span, "unused macro definition");
for (_, &(node_id, ident)) in self.unused_macros.iter() {
self.lint_buffer.buffer_lint(
UNUSED_MACROS,
node_id,
ident.span,
&format!("unused macro definition: `{}`", ident.as_str()),
);
}
}