Skip to content

Commit d29915a

Browse files
committed
add a test case for decl_macro
1 parent 0d24405 commit d29915a

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
// edition:2021
22

3+
#![feature(decl_macro)]
4+
35
mod 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

1117
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
11
error[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
|
44
LL | pub use bar as _;
55
| ^^^^^^^^
66
|
77
help: 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
|
1010
LL | / macro_rules! bar {
1111
LL | | () => {};
1212
LL | | }
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

1729
For more information about this error, try `rustc --explain E0364`.

0 commit comments

Comments
 (0)