File tree 4 files changed +12
-13
lines changed
4 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -3513,7 +3513,6 @@ dependencies = [
3513
3513
name = " rustc_feature"
3514
3514
version = " 0.0.0"
3515
3515
dependencies = [
3516
- " lazy_static" ,
3517
3516
" rustc_data_structures" ,
3518
3517
" rustc_span" ,
3519
3518
]
Original file line number Diff line number Diff line change @@ -9,5 +9,4 @@ doctest = false
9
9
10
10
[dependencies ]
11
11
rustc_data_structures = { path = " ../rustc_data_structures" }
12
- lazy_static = " 1.0.0"
13
12
rustc_span = { path = " ../rustc_span" }
Original file line number Diff line number Diff line change @@ -5,10 +5,11 @@ use AttributeType::*;
5
5
6
6
use crate :: { Features , Stability } ;
7
7
8
- use lazy_static:: lazy_static;
9
8
use rustc_data_structures:: fx:: FxHashMap ;
10
9
use rustc_span:: symbol:: { sym, Symbol } ;
11
10
11
+ use std:: lazy:: SyncLazy ;
12
+
12
13
type GateFn = fn ( & Features ) -> bool ;
13
14
14
15
macro_rules! cfg_fn {
@@ -589,14 +590,12 @@ pub fn is_builtin_attr_name(name: Symbol) -> bool {
589
590
BUILTIN_ATTRIBUTE_MAP . get ( & name) . is_some ( )
590
591
}
591
592
592
- lazy_static ! {
593
- pub static ref BUILTIN_ATTRIBUTE_MAP : FxHashMap <Symbol , & ' static BuiltinAttribute > = {
594
- let mut map = FxHashMap :: default ( ) ;
595
- for attr in BUILTIN_ATTRIBUTES . iter( ) {
596
- if map. insert( attr. 0 , attr) . is_some( ) {
597
- panic!( "duplicate builtin attribute `{}`" , attr. 0 ) ;
598
- }
593
+ pub static BUILTIN_ATTRIBUTE_MAP : SyncLazy < FxHashMap < Symbol , & ' static BuiltinAttribute > > = SyncLazy :: new ( || {
594
+ let mut map = FxHashMap :: default ( ) ;
595
+ for attr in BUILTIN_ATTRIBUTES . iter ( ) {
596
+ if map. insert ( attr. 0 , attr) . is_some ( ) {
597
+ panic ! ( "duplicate builtin attribute `{}`" , attr. 0 ) ;
599
598
}
600
- map
601
- } ;
602
- }
599
+ }
600
+ map
601
+ } ) ;
Original file line number Diff line number Diff line change 11
11
//! even if it is stabilized or removed, *do not remove it*. Instead, move the
12
12
//! symbol to the `accepted` or `removed` modules respectively.
13
13
14
+ #![ feature( once_cell) ]
15
+
14
16
mod accepted;
15
17
mod active;
16
18
mod builtin_attrs;
You can’t perform that action at this time.
0 commit comments