fix: filter out cfg disabled filed when lowering RecordPat

This commit is contained in:
Young-Flash 2024-01-25 19:27:37 +08:00
parent d410d4a2ba
commit 4505f03fbf

View file

@ -1335,6 +1335,7 @@ impl ExprCollector<'_> {
let args = record_pat_field_list let args = record_pat_field_list
.fields() .fields()
.filter_map(|f| { .filter_map(|f| {
self.check_cfg(&f)?;
let ast_pat = f.pat()?; let ast_pat = f.pat()?;
let pat = self.collect_pat(ast_pat, binding_list); let pat = self.collect_pat(ast_pat, binding_list);
let name = f.field_name()?.as_name(); let name = f.field_name()?.as_name();