Skip to content

Commit ce1a38c

Browse files
alexcrichtonnikomatsakis
authored andcommittedJan 6, 2017
rustc: Stabilize the proc_macro feature
This commit stabilizes the `proc_macro` and `proc_macro_lib` features in the compiler to stabilize the "Macros 1.1" feature of the language. Many more details can be found on the tracking issue, #35900. Closes #35900
1 parent bce648c commit ce1a38c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+13
-188
lines changed
 

‎src/libproc_macro/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
//! Currently the primary use of this crate is to provide the ability to define
1616
//! new custom derive modes through `#[proc_macro_derive]`.
1717
//!
18-
//! Added recently as part of [RFC 1681] this crate is currently *unstable* and
19-
//! requires the `#![feature(proc_macro_lib)]` directive to use.
18+
//! Added recently as part of [RFC 1681] this crate is stable as of Rust 1.15.0.
2019
//!
2120
//! [RFC 1681]: https://github.com/rust-lang/rfcs/blob/master/text/1681-macros-1.1.md
2221
//!
@@ -27,7 +26,7 @@
2726
//! area for macro authors is stabilized.
2827
2928
#![crate_name = "proc_macro"]
30-
#![unstable(feature = "proc_macro_lib", issue = "27812")]
29+
#![stable(feature = "proc_macro_lib", since = "1.15.0")]
3130
#![crate_type = "rlib"]
3231
#![crate_type = "dylib"]
3332
#![cfg_attr(not(stage0), deny(warnings))]
@@ -55,12 +54,14 @@ use syntax::ptr::P;
5554
///
5655
/// The API of this type is intentionally bare-bones, but it'll be expanded over
5756
/// time!
57+
#[stable(feature = "proc_macro_lib", since = "1.15.0")]
5858
pub struct TokenStream {
5959
inner: Vec<P<ast::Item>>,
6060
}
6161

6262
/// Error returned from `TokenStream::from_str`.
6363
#[derive(Debug)]
64+
#[stable(feature = "proc_macro_lib", since = "1.15.0")]
6465
pub struct LexError {
6566
_inner: (),
6667
}
@@ -131,6 +132,7 @@ pub mod __internal {
131132
}
132133
}
133134

135+
#[stable(feature = "proc_macro_lib", since = "1.15.0")]
134136
impl FromStr for TokenStream {
135137
type Err = LexError;
136138

@@ -154,6 +156,7 @@ impl FromStr for TokenStream {
154156
}
155157
}
156158

159+
#[stable(feature = "proc_macro_lib", since = "1.15.0")]
157160
impl fmt::Display for TokenStream {
158161
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
159162
for item in self.inner.iter() {

‎src/librustc_driver/driver.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,8 +714,7 @@ pub fn phase_2_configure_and_expand<F>(sess: &Session,
714714
is_proc_macro_crate,
715715
is_test_crate,
716716
num_crate_types,
717-
sess.diagnostic(),
718-
&sess.features.borrow())
717+
sess.diagnostic())
719718
});
720719
}
721720

0 commit comments

Comments
 (0)