@@ -5,7 +5,7 @@ static WORKS: AtomicUsize = AtomicUsize::new(0);
55static INIT : Once = Once :: new ( ) ;
66
77pub ( crate ) fn inside_proc_macro ( ) -> bool {
8- match WORKS . load ( Ordering :: SeqCst ) {
8+ match WORKS . load ( Ordering :: Relaxed ) {
99 1 => return false ,
1010 2 => return true ,
1111 _ => { }
@@ -16,7 +16,7 @@ pub(crate) fn inside_proc_macro() -> bool {
1616}
1717
1818pub ( crate ) fn force_fallback ( ) {
19- WORKS . store ( 1 , Ordering :: SeqCst ) ;
19+ WORKS . store ( 1 , Ordering :: Relaxed ) ;
2020}
2121
2222pub ( crate ) fn unforce_fallback ( ) {
@@ -26,7 +26,7 @@ pub(crate) fn unforce_fallback() {
2626#[ cfg( not( no_is_available) ) ]
2727fn initialize ( ) {
2828 let available = proc_macro:: is_available ( ) ;
29- WORKS . store ( available as usize + 1 , Ordering :: SeqCst ) ;
29+ WORKS . store ( available as usize + 1 , Ordering :: Relaxed ) ;
3030}
3131
3232// Swap in a null panic hook to avoid printing "thread panicked" to stderr,
@@ -65,7 +65,7 @@ fn initialize() {
6565 panic:: set_hook ( null_hook) ;
6666
6767 let works = panic:: catch_unwind ( proc_macro:: Span :: call_site) . is_ok ( ) ;
68- WORKS . store ( works as usize + 1 , Ordering :: SeqCst ) ;
68+ WORKS . store ( works as usize + 1 , Ordering :: Relaxed ) ;
6969
7070 let hopefully_null_hook = panic:: take_hook ( ) ;
7171 panic:: set_hook ( original_hook) ;
0 commit comments