File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 11// edition:2021
22
3+ #![ feature( decl_macro) ]
4+
35mod foo {
46 macro_rules! bar {
57 ( ) => { } ;
68 }
79
810 pub use bar as _; //~ ERROR `bar` is only public within the crate, and cannot be re-exported outside
11+
12+ macro baz( ) { }
13+
14+ pub use baz as _; //~ ERROR `baz` is private, and cannot be re-exported
915}
1016
1117fn main ( ) { }
Original file line number Diff line number Diff line change 11error[E0364]: `bar` is only public within the crate, and cannot be re-exported outside
2- --> $DIR/macro-private-reexport.rs:8 :13
2+ --> $DIR/macro-private-reexport.rs:10 :13
33 |
44LL | pub use bar as _;
55 | ^^^^^^^^
66 |
77help: consider adding a `#[macro_export]` to the macro in the imported module
8- --> $DIR/macro-private-reexport.rs:4 :5
8+ --> $DIR/macro-private-reexport.rs:6 :5
99 |
1010LL | / macro_rules! bar {
1111LL | | () => {};
1212LL | | }
1313 | |_____^
1414
15- error: aborting due to previous error
15+ error[E0364]: `baz` is private, and cannot be re-exported
16+ --> $DIR/macro-private-reexport.rs:14:13
17+ |
18+ LL | pub use baz as _;
19+ | ^^^^^^^^
20+ |
21+ note: consider marking `baz` as `pub` in the imported module
22+ --> $DIR/macro-private-reexport.rs:14:13
23+ |
24+ LL | pub use baz as _;
25+ | ^^^^^^^^
26+
27+ error: aborting due to 2 previous errors
1628
1729For more information about this error, try `rustc --explain E0364`.
You can’t perform that action at this time.
0 commit comments