Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
// rustc-cfg emitted by the build script:
//
// "use_proc_macro"
// Link to extern crate proc_macro. Requires "proc-macro" Cargo cfg to be
// enabled (default is enabled).
//
// "wrap_proc_macro"
// Wrap types from libproc_macro rather than polyfilling the whole API.
// Enabled on rustc 1.29+ as long as procmacro2_semver_exempt is not set,
Expand Down Expand Up @@ -111,8 +107,6 @@ fn main() {
return;
}

println!("cargo:rustc-cfg=use_proc_macro");

if version.nightly || !semver_exempt {
println!("cargo:rustc-cfg=wrap_proc_macro");
}
Expand Down
4 changes: 2 additions & 2 deletions src/fallback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ impl Debug for TokenStream {
}
}

#[cfg(use_proc_macro)]
#[cfg(feature = "proc-macro")]
impl From<proc_macro::TokenStream> for TokenStream {
fn from(inner: proc_macro::TokenStream) -> Self {
inner
Expand All @@ -243,7 +243,7 @@ impl From<proc_macro::TokenStream> for TokenStream {
}
}

#[cfg(use_proc_macro)]
#[cfg(feature = "proc-macro")]
impl From<TokenStream> for proc_macro::TokenStream {
fn from(inner: TokenStream) -> Self {
inner
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ compile_error! {"\
build script as well.
"}

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

mod marker;
Expand Down Expand Up @@ -236,14 +236,14 @@ impl FromStr for TokenStream {
}
}

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

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