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> {
21
21
pub ( super ) fn new ( counter : & ' static AtomicU32 ) -> Self {
22
22
// Ensure the handle counter isn't 0, which would panic later,
23
23
// 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 ) ;
25
25
26
26
OwnedStore { counter, data : BTreeMap :: new ( ) }
27
27
}
28
28
}
29
29
30
30
impl < T > OwnedStore < T > {
31
31
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 ) ;
33
33
let handle = Handle :: new ( counter) . expect ( "`proc_macro` handle counter overflowed" ) ;
34
34
assert ! ( self . data. insert( handle, x) . is_none( ) ) ;
35
35
handle
You can’t perform that action at this time.
0 commit comments