Unnamed repository; edit this file 'description' to name the repository.
fix: filter out cfg disabled filed when lowering `RecordPat`
Young-Flash 2024-01-25
parent d410d4a · commit 4505f03
-rw-r--r--crates/hir-def/src/body/lower.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/hir-def/src/body/lower.rs b/crates/hir-def/src/body/lower.rs
index 5fc4867bfa..492ea6d5c5 100644
--- a/crates/hir-def/src/body/lower.rs
+++ b/crates/hir-def/src/body/lower.rs
@@ -1335,6 +1335,7 @@ impl ExprCollector<'_> {
let args = record_pat_field_list
.fields()
.filter_map(|f| {
+ self.check_cfg(&f)?;
let ast_pat = f.pat()?;
let pat = self.collect_pat(ast_pat, binding_list);
let name = f.field_name()?.as_name();