Skip to content

Commit b185fa3

Browse files
committed
ast: Keep expansion status for out-of-line module items
Also remove `ast::Mod` which is mostly redundant now
1 parent a149f61 commit b185fa3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

clippy_lints/src/utils/ast_utils.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,12 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool {
241241
&& eq_generics(lg, rg)
242242
&& both(lb, rb, |l, r| eq_block(l, r))
243243
}
244-
(Mod(l), Mod(r)) => {
245-
l.inline == r.inline && over(&l.items, &r.items, |l, r| eq_item(l, r, eq_item_kind))
246-
}
244+
(Mod(lu, lmk), Mod(ru, rmk)) => lu == ru && match (lmk, rmk) {
245+
(ModKind::Loaded(litems, linline, _), ModKind::Loaded(ritems, rinline, _)) =>
246+
linline == rinline && over(litems, ritems, |l, r| eq_item(l, r, eq_item_kind)),
247+
(ModKind::Unloaded, ModKind::Unloaded) => true,
248+
_ => false,
249+
},
247250
(ForeignMod(l), ForeignMod(r)) => {
248251
both(&l.abi, &r.abi, |l, r| eq_str_lit(l, r))
249252
&& over(&l.items, &r.items, |l, r| eq_item(l, r, eq_foreign_item_kind))

0 commit comments

Comments
 (0)