diff --git a/compiler/rustc_metadata/src/rmeta/decoder.rs b/compiler/rustc_metadata/src/rmeta/decoder.rs index b2c7818a54218..153899b3526d9 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder.rs @@ -1099,10 +1099,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> { }; // Iterate over all children. - let macros_only = self.dep_kind.lock().macros_only(); - if !macros_only { - let children = self.root.tables.children.get(self, id).unwrap_or_else(Lazy::empty); - + if let Some(children) = self.root.tables.children.get(self, id) { for child_index in children.decode((self, sess)) { // Get the item. let child_kind = match self.maybe_kind(child_index) { @@ -1200,11 +1197,6 @@ impl<'a, 'tcx> CrateMetadataRef<'a> { if let EntryKind::Mod(exports) = kind { for exp in exports.decode((self, sess)) { - match exp.res { - Res::Def(DefKind::Macro(..), _) => {} - _ if macros_only => continue, - _ => {} - } callback(exp); } } diff --git a/src/test/ui/no-link.rs b/src/test/ui/no-link.rs index 939271832e3df..c80e61b451116 100644 --- a/src/test/ui/no-link.rs +++ b/src/test/ui/no-link.rs @@ -1,8 +1,9 @@ +// check-pass // aux-build:empty-struct.rs #[no_link] extern crate empty_struct; fn main() { - empty_struct::XEmpty1; //~ ERROR cannot find value `XEmpty1` in crate `empty_struct` + empty_struct::XEmpty1 {}; } diff --git a/src/test/ui/no-link.stderr b/src/test/ui/no-link.stderr deleted file mode 100644 index 66a74ff65601b..0000000000000 --- a/src/test/ui/no-link.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0425]: cannot find value `XEmpty1` in crate `empty_struct` - --> $DIR/no-link.rs:7:19 - | -LL | empty_struct::XEmpty1; - | ^^^^^^^ not found in `empty_struct` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0425`.