Skip to content

Commit

Permalink
Fix usage of proc_macro::is_available()
Browse files Browse the repository at this point in the history
In #300 I made a mistake with the #[cfg] causing
proc_macro::is_available() to never actually be used. I have now
double checked that it is actually used on Rust 1.57+.
  • Loading branch information
bjorn3 committed Dec 2, 2021
1 parent 162fff2 commit f601ea3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub(crate) fn unforce_fallback() {
initialize();
}

#[cfg(feature = "is_available")]
#[cfg(is_available)]
fn initialize() {
let available = proc_macro::is_available();
WORKS.store(available as usize + 1, Ordering::SeqCst);
Expand Down Expand Up @@ -54,7 +54,7 @@ fn initialize() {
// here. For now, if a user needs to guarantee that this failure mode does
// not occur, they need to call e.g. `proc_macro2::Span::call_site()` from
// the main thread before launching any other threads.
#[cfg(not(feature = "is_available"))]
#[cfg(not(is_available))]
fn initialize() {
type PanicHook = dyn Fn(&PanicInfo) + Sync + Send + 'static;

Expand Down

0 comments on commit f601ea3

Please sign in to comment.