1414//! to use this crate will be trivially able to switch to the upstream
1515//! `proc_macro` crate once its API stabilizes.
1616//!
17- //! In the meantime this crate also has an `unstable ` Cargo feature which
17+ //! In the meantime this crate also has a `nightly ` Cargo feature which
1818//! enables it to reimplement itself with the unstable API of `proc_macro`.
1919//! This'll allow immediate usage of the beneficial upstream API, particularly
2020//! around preserving span information.
2121
22- #![ cfg_attr( feature = "unstable " , feature( proc_macro) ) ]
22+ #![ cfg_attr( feature = "nightly " , feature( proc_macro) ) ]
2323
2424extern crate proc_macro;
2525
26- #[ cfg( not( feature = "unstable " ) ) ]
26+ #[ cfg( not( feature = "nightly " ) ) ]
2727extern crate unicode_xid;
2828
2929use std:: fmt;
3030use std:: str:: FromStr ;
3131use std:: iter:: FromIterator ;
3232
3333#[ macro_use]
34- #[ cfg( not( feature = "unstable " ) ) ]
34+ #[ cfg( not( feature = "nightly " ) ) ]
3535mod strnom;
3636
3737#[ path = "stable.rs" ]
38- #[ cfg( not( feature = "unstable " ) ) ]
38+ #[ cfg( not( feature = "nightly " ) ) ]
3939mod imp;
4040#[ path = "unstable.rs" ]
41- #[ cfg( feature = "unstable " ) ]
41+ #[ cfg( feature = "nightly " ) ]
4242mod imp;
4343
4444#[ macro_use]
@@ -104,14 +104,14 @@ impl TokenStream {
104104}
105105
106106// Returned by reference, so we can't easily wrap it.
107- #[ cfg( procmacro2_unstable ) ]
107+ #[ cfg( procmacro2_semver_exempt ) ]
108108pub use imp:: FileName ;
109109
110- #[ cfg( procmacro2_unstable ) ]
110+ #[ cfg( procmacro2_semver_exempt ) ]
111111#[ derive( Clone , PartialEq , Eq ) ]
112112pub struct SourceFile ( imp:: SourceFile ) ;
113113
114- #[ cfg( procmacro2_unstable ) ]
114+ #[ cfg( procmacro2_semver_exempt ) ]
115115impl SourceFile {
116116 /// Get the path to this source file as a string.
117117 pub fn path ( & self ) -> & FileName {
@@ -123,21 +123,21 @@ impl SourceFile {
123123 }
124124}
125125
126- #[ cfg( procmacro2_unstable ) ]
126+ #[ cfg( procmacro2_semver_exempt ) ]
127127impl AsRef < FileName > for SourceFile {
128128 fn as_ref ( & self ) -> & FileName {
129129 self . 0 . path ( )
130130 }
131131}
132132
133- #[ cfg( procmacro2_unstable ) ]
133+ #[ cfg( procmacro2_semver_exempt ) ]
134134impl fmt:: Debug for SourceFile {
135135 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
136136 self . 0 . fmt ( f)
137137 }
138138}
139139
140- #[ cfg( procmacro2_unstable ) ]
140+ #[ cfg( procmacro2_semver_exempt ) ]
141141pub struct LineColumn {
142142 pub line : usize ,
143143 pub column : usize ,
@@ -162,30 +162,30 @@ impl Span {
162162 Span ( imp:: Span :: def_site ( ) )
163163 }
164164
165- /// This method is only available when the `"unstable "` feature is enabled.
166- #[ cfg( feature = "unstable " ) ]
165+ /// This method is only available when the `"nightly "` feature is enabled.
166+ #[ cfg( feature = "nightly " ) ]
167167 pub fn unstable ( self ) -> proc_macro:: Span {
168168 self . 0 . unstable ( )
169169 }
170170
171- #[ cfg( procmacro2_unstable ) ]
171+ #[ cfg( procmacro2_semver_exempt ) ]
172172 pub fn source_file ( & self ) -> SourceFile {
173173 SourceFile ( self . 0 . source_file ( ) )
174174 }
175175
176- #[ cfg( procmacro2_unstable ) ]
176+ #[ cfg( procmacro2_semver_exempt ) ]
177177 pub fn start ( & self ) -> LineColumn {
178178 let imp:: LineColumn { line, column } = self . 0 . start ( ) ;
179179 LineColumn { line : line, column : column }
180180 }
181181
182- #[ cfg( procmacro2_unstable ) ]
182+ #[ cfg( procmacro2_semver_exempt ) ]
183183 pub fn end ( & self ) -> LineColumn {
184184 let imp:: LineColumn { line, column } = self . 0 . end ( ) ;
185185 LineColumn { line : line, column : column }
186186 }
187187
188- #[ cfg( procmacro2_unstable ) ]
188+ #[ cfg( procmacro2_semver_exempt ) ]
189189 pub fn join ( & self , other : Span ) -> Option < Span > {
190190 self . 0 . join ( other. 0 ) . map ( Span )
191191 }
0 commit comments