File tree 2 files changed +21
-3
lines changed
2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 1
1
// edition:2021
2
2
3
+ #![ feature( decl_macro) ]
4
+
3
5
mod foo {
4
6
macro_rules! bar {
5
7
( ) => { } ;
6
8
}
7
9
8
10
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
9
15
}
10
16
11
17
fn main ( ) { }
Original file line number Diff line number Diff line change 1
1
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
3
3
|
4
4
LL | pub use bar as _;
5
5
| ^^^^^^^^
6
6
|
7
7
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
9
9
|
10
10
LL | / macro_rules! bar {
11
11
LL | | () => {};
12
12
LL | | }
13
13
| |_____^
14
14
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
16
28
17
29
For more information about this error, try `rustc --explain E0364`.
You can’t perform that action at this time.
0 commit comments