This commit is contained in:
ivan770 2021-05-16 20:05:52 +02:00
parent 201dbbe6da
commit a79b54ef73
No known key found for this signature in database
GPG Key ID: D8C4BD5AE4D9CC4D
2 changed files with 19 additions and 0 deletions

View File

@ -481,6 +481,10 @@ impl DefCollector<'_> {
let res = self.def_map.resolve_name_in_extern_prelude(self.db, &extern_crate.name);
if let Some(ModuleDefId::ModuleId(m)) = res.take_types() {
if m == self.def_map.module_id(current_module_id) {
return;
}
cov_mark::hit!(macro_rules_from_other_crates_are_visible_with_macro_use);
self.import_all_macros_exported(current_module_id, m.krate);
}

View File

@ -410,6 +410,21 @@ struct Arc;
);
}
#[test]
fn extern_crate_self() {
check(
r#"
//- /main.rs crate:main
#[macro_use]
extern crate self as bla;
"#,
expect![[r#"
crate
bla: t
"#]],
);
}
#[test]
fn reexport_across_crates() {
check(