Open
Description
This is a tracking issue for the private_macro_use
, a lint that follows the breaking change policy.
Description
The root of this issue was originally posted in #119301. A macro that should not have been exported was indeed exported. A minimal example to illustrate this issue is shown below:
// extern_macro.rs
macro_rules! foo_ { () => {} };
use foo_ as foo;
// code.rs
#[macro_use]
extern crate extern_macro;
fn main() {
foo!(); // this should trigger a compile error, but it doesn't
}
The problem was triggered by an oversight where a visibility check for the macro, defined in an external crate, was omitted. Now, we have reintroduced this check to prevent such issues from occurring.
Steps
- Implement: exclude unexported macro bindings from extern crate #119369
- Make it as an error