Skip to content

Commit 339c69d

Browse files
committed
Check cfg_matches_host for type rules as well
1 parent 5c3eb88 commit 339c69d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

rule-preprocessor/src/syntactic.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ impl SyntacticAnalysis {
121121
let mut file_ir = FileIr::new();
122122

123123
for fn_item in source_file.syntax().descendants().filter_map(ast::Fn::cast) {
124+
if !cfg_matches_host(&fn_item) {
125+
continue;
126+
}
127+
124128
let Some(name) = fn_item.name() else { continue };
125129
let fn_name = name.text().to_string();
126130

@@ -130,9 +134,6 @@ impl SyntacticAnalysis {
130134
RuleIr::Type(TypeIrBuilder::new(&fn_item).build()),
131135
);
132136
} else if fn_name.starts_with('f') {
133-
if !cfg_matches_host(&fn_item) {
134-
continue;
135-
}
136137
file_ir.insert(
137138
fn_name.clone(),
138139
RuleIr::Fn(FnIrBuilder::new(&fn_item).build(path)),

0 commit comments

Comments
 (0)