Skip to content

Commit 675059a

Browse files
committed
Clean up convoluted macros_only logic
1 parent e821a6e commit 675059a

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

compiler/rustc_metadata/src/rmeta/decoder.rs

+9-13
Original file line numberDiff line numberDiff line change
@@ -1055,19 +1055,15 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
10551055

10561056
// Iterate over all children.
10571057
let macros_only = self.dep_kind.lock().macros_only();
1058-
let children = self.root.tables.children.get(self, id).unwrap_or_else(Lazy::empty);
1059-
for child_index in children.decode((self, sess)) {
1060-
if macros_only {
1061-
continue;
1062-
}
1063-
1064-
// Get the item.
1065-
if let Some(child_kind) = self.maybe_kind(child_index) {
1066-
match child_kind {
1067-
EntryKind::MacroDef(..) => {}
1068-
_ if macros_only => continue,
1069-
_ => {}
1070-
}
1058+
if !macros_only {
1059+
let children = self.root.tables.children.get(self, id).unwrap_or_else(Lazy::empty);
1060+
1061+
for child_index in children.decode((self, sess)) {
1062+
// Get the item.
1063+
let child_kind = match self.maybe_kind(child_index) {
1064+
Some(child_kind) => child_kind,
1065+
None => continue,
1066+
};
10711067

10721068
// Hand off the item to the callback.
10731069
match child_kind {

0 commit comments

Comments
 (0)