]> git.lizzy.rs Git - rust.git/commit
Auto merge of #51496 - petrochenkov:mhelper2, r=nikomatsakis
authorbors <bors@rust-lang.org>
Wed, 27 Jun 2018 11:20:16 +0000 (11:20 +0000)
committerbors <bors@rust-lang.org>
Wed, 27 Jun 2018 11:20:16 +0000 (11:20 +0000)
commit142c98dd5a9fbd60c13e62a5c1358a40ee622dbb
tree903290645b3895b243b4bef0a1ffc794f793ebee
parentc20824323cf7ed6ad95cb8d7b780a7934927a753
parentd347270e0c241823d6e3333060f5ee902fffee6a
Auto merge of #51496 - petrochenkov:mhelper2, r=nikomatsakis

Implement `#[macro_export(local_inner_macros)]` (a solution for the macro helper import problem)

Implement a solution for the macro helper issue discussed in https://github.com/rust-lang/rust/issues/35896 as described in https://github.com/rust-lang/rust/issues/35896#issuecomment-395977901.

Macros exported from libraries can be marked with `#[macro_export(local_inner_macros)]` and this annotation changes how nested macros in them are resolved.

If we have a fn-like macro call `ident!(...)` and `ident` comes from a `macro_rules!` macro marked with  `#[macro_export(local_inner_macros)]` then it's replaced with `$crate::ident!(...)` and resolved as such (`$crate` gets the same context as `ident`).