Skip to content

Document local_inner_macros #53464

Closed
Closed
@SimonSapin

Description

@SimonSapin

Was: `matches` crate regression: error[E0433]: failed to resolve. Did you mean `std::panic`?


Reduced test case:

#[macro_export(local_inner_macros)]
macro_rules! assert_matches {
    () => {
        panic!()
    }
}

fn main() {
    assert_matches!();
}
$ rustup run --install nightly-2018-08-17 rustc -V  
rustc 1.30.0-nightly (b2028828d 2018-08-16)
$ rustup run --install nightly-2018-08-17 rustc a.rs
$ rustup run --install nightly-2018-08-18 rustc -V 
rustc 1.30.0-nightly (1fa944914 2018-08-17)
$ rustup run --install nightly-2018-08-18 rustc a.rs
error[E0433]: failed to resolve. Did you mean `std::panic`?
 --> a.rs:4:9
  |
4 |         panic!()
  |         ^^^^^ Did you mean `std::panic`?
...
9 |     assert_matches!();
  |     ------------------ in this macro invocation

error: aborting due to previous error

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

Commit range: b202882...1fa9449
Likely candidate: #50911 Stabilize use_extern_macros, CC @petrochenkov

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions