Skip to content

Commit f601ea3

Browse files
committed
Fix usage of proc_macro::is_available()
In dtolnay#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+.
1 parent 162fff2 commit f601ea3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/detection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub(crate) fn unforce_fallback() {
2424
initialize();
2525
}
2626

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

0 commit comments

Comments
 (0)