Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustc: Stabilize the proc_macro feature #52081

Merged
merged 1 commit into from
Jul 16, 2018

Commits on Jul 16, 2018

  1. rustc: Stabilize much of the proc_macro feature

    This commit stabilizes some of the `proc_macro` language feature as well as a
    number of APIs in the `proc_macro` crate as [previously discussed][1]. This
    means that on stable Rust you can now define custom procedural macros which
    operate as attributes attached to items or `macro_rules!`-like bang-style
    invocations. This extends the suite of currently stable procedural macros,
    custom derives, with custom attributes and custom bang macros.
    
    Note though that despite the stabilization in this commit procedural macros are
    still not usable on stable Rust. To stabilize that we'll need to stabilize at
    least part of the `use_extern_macros` feature. Currently you can define a
    procedural macro attribute but you can't import it to call it!
    
    A summary of the changes made in this PR (as well as the various consequences)
    is:
    
    * The `proc_macro` language and library features are now stable.
    * Other APIs not stabilized in the `proc_macro` crate are now named under a
      different feature, such as `proc_macro_diagnostic` or `proc_macro_span`.
    * A few checks in resolution for `proc_macro` being enabled have switched over
      to `use_extern_macros` being enabled. This means that code using
      `#![feature(proc_macro)]` today will likely need to move to
      `#![feature(use_extern_macros)]`.
    
    It's intended that this PR, once landed, will be followed up with an attempt to
    stabilize a small slice of `use_extern_macros` just for procedural macros to
    make this feature 100% usable on stable.
    
    [1]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252
    alexcrichton committed Jul 16, 2018
    Configuration menu
    Copy the full SHA
    65f3007 View commit details
    Browse the repository at this point in the history