File tree Expand file tree Collapse file tree 4 files changed +12
-13
lines changed Expand file tree Collapse file tree 4 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -3513,7 +3513,6 @@ dependencies = [
35133513name = " rustc_feature"
35143514version = " 0.0.0"
35153515dependencies = [
3516- " lazy_static" ,
35173516 " rustc_data_structures" ,
35183517 " rustc_span" ,
35193518]
Original file line number Diff line number Diff line change @@ -9,5 +9,4 @@ doctest = false
99
1010[dependencies ]
1111rustc_data_structures = { path = " ../rustc_data_structures" }
12- lazy_static = " 1.0.0"
1312rustc_span = { path = " ../rustc_span" }
Original file line number Diff line number Diff line change @@ -5,10 +5,11 @@ use AttributeType::*;
55
66use crate :: { Features , Stability } ;
77
8- use lazy_static:: lazy_static;
98use rustc_data_structures:: fx:: FxHashMap ;
109use rustc_span:: symbol:: { sym, Symbol } ;
1110
11+ use std:: lazy:: SyncLazy ;
12+
1213type GateFn = fn ( & Features ) -> bool ;
1314
1415macro_rules! cfg_fn {
@@ -589,14 +590,12 @@ pub fn is_builtin_attr_name(name: Symbol) -> bool {
589590 BUILTIN_ATTRIBUTE_MAP . get ( & name) . is_some ( )
590591}
591592
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 ) ;
599598 }
600- map
601- } ;
602- }
599+ }
600+ map
601+ } ) ;
Original file line number Diff line number Diff line change 1111//! even if it is stabilized or removed, *do not remove it*. Instead, move the
1212//! symbol to the `accepted` or `removed` modules respectively.
1313
14+ #![ feature( once_cell) ]
15+
1416mod accepted;
1517mod active;
1618mod builtin_attrs;
You can’t perform that action at this time.
0 commit comments