Lint empty 'derive()' as unused attribute.

This commit is contained in:
Mazdak Farrokhzad 2019-06-22 13:19:34 +02:00
parent 305930cffe
commit e994d35e9b
5 changed files with 14 additions and 18 deletions

View file

@ -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