-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #37213 - jseyfried:refactor_crate_var, r=nrc
macros: improve `$crate` This PR refactors the implementation of `$crate` so that - `$crate` is only allowed at the start of a path (like `super`), - we can make `$crate` work with inter-crate re-exports (groundwork for macro modularization), and - we can support importing macros from an extern crate that is not declared at the crate root (also groundwork for macro modularization). This is a [breaking-change]. For example, the following would break: ```rust fn foo() {} macro_rules! m { () => { $crate foo $crate () $crate $crate; //^ Today, `$crate` is allowed just about anywhere in unexported macros. } } fn main() { m!(); } ``` r? @nrc
- Loading branch information
Showing
14 changed files
with
97 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.