Closed
Description
Given the following code: playground
macro_rules! foo {
() => {};
}
pub use foo;
The current output is:
error[[E0364]](https://doc.rust-lang.org/stable/error-index.html#E0364): `foo` is only public within the crate, and cannot be re-exported outside
--> src/lib.rs:4:9
|
4 | pub use foo;
| ^^^
|
note: consider marking `foo` as `pub` in the imported module
--> src/lib.rs:4:9
|
4 | pub use foo;
| ^^^
Ideally the output should probably look like:
error[[E0364]](https://doc.rust-lang.org/stable/error-index.html#E0364): `foo` is only public within the crate, and cannot be re-exported outside
--> src/lib.rs:4:9
|
4 | pub use foo;
| ^^^
|
note: consider marking `foo` as `#[macro_export]`
--> src/lib.rs:4:9
|
| #[macro_export]
1 | macro_rules! foo {
|
This error does not help explain how to fix it. In addition to explaining #[macro_export]
, pub(crate) use foo;
could also be shown, so the user can decide what they wanted to do.