Lint empty 'derive()' as unused attribute.
This commit is contained in:
parent
305930cffe
commit
e994d35e9b
5 changed files with 14 additions and 18 deletions
|
|
@ -30,10 +30,6 @@ pub fn collect_derives(cx: &mut ExtCtxt<'_>, attrs: &mut Vec<ast::Attribute>) ->
|
|||
|
||||
match attr.parse_list(cx.parse_sess,
|
||||
|parser| parser.parse_path_allowing_meta(PathStyle::Mod)) {
|
||||
Ok(ref traits) if traits.is_empty() => {
|
||||
cx.span_warn(attr.span, "empty trait list in `derive`");
|
||||
false
|
||||
}
|
||||
Ok(traits) => {
|
||||
result.extend(traits);
|
||||
true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue