3 #![feature(decl_macro)]
6 // Non-exported legacy macros are treated as `pub(crate)`.
7 macro_rules
! legacy_macro { () => () }
9 use legacy_macro
as _
; // OK
10 pub(crate) use legacy_macro
as _
; // OK
11 pub use legacy_macro
as _
; //~ ERROR `legacy_macro` is only public within the crate, and cannot be re-exported outside
15 macro_rules
! legacy_macro { () => () }
17 #[allow(non_camel_case_types)]
18 type legacy_macro
= u8;
20 // Legacy macro imports don't prevent names from other namespaces from being imported.
21 use legacy_macro
as _
; // OK
25 macro legacy_macro() {}
28 macro_rules
! legacy_macro { () => () }
30 // Legacy macro imports create ambiguities with other names in the same namespace.
31 use legacy_macro
as _
; //~ ERROR `legacy_macro` is ambiguous
36 // Exported legacy macros are treated as `pub`.
38 macro_rules
! legacy_macro { () => () }
40 pub use legacy_macro
as _
; // OK