File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
library/proc_macro/src/bridge Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -21,15 +21,15 @@ impl<T> OwnedStore<T> {
2121 pub ( super ) fn new ( counter : & ' static AtomicU32 ) -> Self {
2222 // Ensure the handle counter isn't 0, which would panic later,
2323 // when `NonZero::new` (aka `Handle::new`) is called in `alloc`.
24- assert_ne ! ( counter. load( Ordering :: SeqCst ) , 0 ) ;
24+ assert_ne ! ( counter. load( Ordering :: Relaxed ) , 0 ) ;
2525
2626 OwnedStore { counter, data : BTreeMap :: new ( ) }
2727 }
2828}
2929
3030impl < T > OwnedStore < T > {
3131 pub ( super ) fn alloc ( & mut self , x : T ) -> Handle {
32- let counter = self . counter . fetch_add ( 1 , Ordering :: SeqCst ) ;
32+ let counter = self . counter . fetch_add ( 1 , Ordering :: Relaxed ) ;
3333 let handle = Handle :: new ( counter) . expect ( "`proc_macro` handle counter overflowed" ) ;
3434 assert ! ( self . data. insert( handle, x) . is_none( ) ) ;
3535 handle
You can’t perform that action at this time.
0 commit comments