feat: add attributes support on struct fields and method #3870

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
This commit is contained in:
Benjamin Coenen 2020-04-08 18:12:15 +02:00
parent 18a5e16483
commit 8f1dba6f9a
4 changed files with 30 additions and 43 deletions

View file

@ -166,14 +166,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
let variant_data = variant_data(db.upcast(), variant_def);
let lit_fields: FxHashSet<_> = fields
.iter()
.filter_map(|f| {
// TODO: check if cfg_is_enabled with .attrs ?
Some(&f.name)
})
.collect();
let lit_fields: FxHashSet<_> = fields.iter().map(|f| &f.name).collect();
let missed_fields: Vec<Name> = variant_data
.fields()
.iter()