diff --git a/src/test/ui/privacy/macro-private-reexport.rs b/src/test/ui/privacy/macro-private-reexport.rs index bc3e6fb5c59..d0aab528ed4 100644 --- a/src/test/ui/privacy/macro-private-reexport.rs +++ b/src/test/ui/privacy/macro-private-reexport.rs @@ -1,11 +1,17 @@ // edition:2021 +#![feature(decl_macro)] + mod foo { macro_rules! bar { () => {}; } pub use bar as _; //~ ERROR `bar` is only public within the crate, and cannot be re-exported outside + + macro baz() {} + + pub use baz as _; //~ ERROR `baz` is private, and cannot be re-exported } fn main() {} diff --git a/src/test/ui/privacy/macro-private-reexport.stderr b/src/test/ui/privacy/macro-private-reexport.stderr index af85cbcf3f2..b8768f3612e 100644 --- a/src/test/ui/privacy/macro-private-reexport.stderr +++ b/src/test/ui/privacy/macro-private-reexport.stderr @@ -1,17 +1,29 @@ error[E0364]: `bar` is only public within the crate, and cannot be re-exported outside - --> $DIR/macro-private-reexport.rs:8:13 + --> $DIR/macro-private-reexport.rs:10:13 | LL | pub use bar as _; | ^^^^^^^^ | help: consider adding a `#[macro_export]` to the macro in the imported module - --> $DIR/macro-private-reexport.rs:4:5 + --> $DIR/macro-private-reexport.rs:6:5 | LL | / macro_rules! bar { LL | | () => {}; LL | | } | |_____^ -error: aborting due to previous error +error[E0364]: `baz` is private, and cannot be re-exported + --> $DIR/macro-private-reexport.rs:14:13 + | +LL | pub use baz as _; + | ^^^^^^^^ + | +note: consider marking `baz` as `pub` in the imported module + --> $DIR/macro-private-reexport.rs:14:13 + | +LL | pub use baz as _; + | ^^^^^^^^ + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0364`.