Skip to content

Commit 2993201

Browse files
committed
Use_proc_macro is now equivalent to feature="proc-macro"
1 parent d62d078 commit 2993201

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

build.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
// rustc-cfg emitted by the build script:
22
//
3-
// "use_proc_macro"
4-
// Link to extern crate proc_macro. Requires "proc-macro" Cargo cfg to be
5-
// enabled (default is enabled).
6-
//
73
// "wrap_proc_macro"
84
// Wrap types from libproc_macro rather than polyfilling the whole API.
95
// Enabled on rustc 1.29+ as long as procmacro2_semver_exempt is not set,
@@ -111,8 +107,6 @@ fn main() {
111107
return;
112108
}
113109

114-
println!("cargo:rustc-cfg=use_proc_macro");
115-
116110
if version.nightly || !semver_exempt {
117111
println!("cargo:rustc-cfg=wrap_proc_macro");
118112
}

src/fallback.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ impl Debug for TokenStream {
233233
}
234234
}
235235

236-
#[cfg(use_proc_macro)]
236+
#[cfg(feature = "proc-macro")]
237237
impl From<proc_macro::TokenStream> for TokenStream {
238238
fn from(inner: proc_macro::TokenStream) -> Self {
239239
inner
@@ -243,7 +243,7 @@ impl From<proc_macro::TokenStream> for TokenStream {
243243
}
244244
}
245245

246-
#[cfg(use_proc_macro)]
246+
#[cfg(feature = "proc-macro")]
247247
impl From<TokenStream> for proc_macro::TokenStream {
248248
fn from(inner: TokenStream) -> Self {
249249
inner

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ compile_error! {"\
120120
build script as well.
121121
"}
122122

123-
#[cfg(use_proc_macro)]
123+
#[cfg(feature = "proc-macro")]
124124
extern crate proc_macro;
125125

126126
mod marker;
@@ -236,14 +236,14 @@ impl FromStr for TokenStream {
236236
}
237237
}
238238

239-
#[cfg(use_proc_macro)]
239+
#[cfg(feature = "proc-macro")]
240240
impl From<proc_macro::TokenStream> for TokenStream {
241241
fn from(inner: proc_macro::TokenStream) -> Self {
242242
TokenStream::_new(inner.into())
243243
}
244244
}
245245

246-
#[cfg(use_proc_macro)]
246+
#[cfg(feature = "proc-macro")]
247247
impl From<TokenStream> for proc_macro::TokenStream {
248248
fn from(inner: TokenStream) -> Self {
249249
inner.inner.into()

0 commit comments

Comments
 (0)