File tree Expand file tree Collapse file tree 3 files changed +9
-15
lines changed Expand file tree Collapse file tree 3 files changed +9
-15
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ swc_core : patch
3
+ swc_common : patch
4
+ ---
5
+
6
+ fix(swc_common): Fix build
Original file line number Diff line number Diff line change 1
- #[ cfg( not( feature = "parking_lot" ) ) ]
2
- use std:: sync:: Mutex ;
3
1
use std:: {
4
2
borrow:: Cow ,
5
3
cmp, fmt,
6
4
hash:: { Hash , Hasher } ,
7
5
ops:: { Add , Sub } ,
8
6
path:: PathBuf ,
9
- sync:: atomic:: AtomicU32 ,
7
+ sync:: { atomic:: AtomicU32 , Mutex } ,
10
8
} ;
11
9
12
- #[ cfg( feature = "parking_lot" ) ]
13
- use parking_lot:: Mutex ;
14
10
use serde:: { Deserialize , Serialize } ;
15
11
use url:: Url ;
16
12
@@ -130,8 +126,8 @@ impl Globals {
130
126
/// Do not use this unless you know what you are doing.
131
127
pub fn clone_data ( & self ) -> Self {
132
128
Globals {
133
- hygiene_data : Mutex :: new ( self . hygiene_data . lock ( ) . clone ( ) ) ,
134
- marks : Mutex :: new ( self . marks . lock ( ) . clone ( ) ) ,
129
+ hygiene_data : Mutex :: new ( self . hygiene_data . lock ( ) . unwrap ( ) . clone ( ) ) ,
130
+ marks : Mutex :: new ( self . marks . lock ( ) . unwrap ( ) . clone ( ) ) ,
135
131
dummy_cnt : AtomicU32 :: new ( self . dummy_cnt . load ( std:: sync:: atomic:: Ordering :: SeqCst ) ) ,
136
132
}
137
133
}
Original file line number Diff line number Diff line change @@ -293,10 +293,6 @@ impl HygieneData {
293
293
294
294
fn with < T , F : FnOnce ( & mut HygieneData ) -> T > ( f : F ) -> T {
295
295
GLOBALS . with ( |globals| {
296
- #[ cfg( feature = "parking_lot" ) ]
297
- return f ( & mut globals. hygiene_data . lock ( ) ) ;
298
-
299
- #[ cfg( not( feature = "parking_lot" ) ) ]
300
296
return f ( & mut globals. hygiene_data . lock ( ) . unwrap ( ) ) ;
301
297
} )
302
298
}
@@ -306,10 +302,6 @@ impl HygieneData {
306
302
#[ allow( unused) ]
307
303
pub ( crate ) fn with_marks < T , F : FnOnce ( & mut Vec < MarkData > ) -> T > ( f : F ) -> T {
308
304
GLOBALS . with ( |globals| {
309
- #[ cfg( feature = "parking_lot" ) ]
310
- return f ( & mut globals. marks . lock ( ) ) ;
311
-
312
- #[ cfg( not( feature = "parking_lot" ) ) ]
313
305
return f ( & mut globals. marks . lock ( ) . unwrap ( ) ) ;
314
306
} )
315
307
}
You can’t perform that action at this time.
0 commit comments