File tree Expand file tree Collapse file tree 5 files changed +14
-19
lines changed Expand file tree Collapse file tree 5 files changed +14
-19
lines changed Original file line number Diff line number Diff line change @@ -3530,7 +3530,6 @@ version = "0.0.0"
35303530name = " rustc_hir"
35313531version = " 0.0.0"
35323532dependencies = [
3533- " lazy_static" ,
35343533 " rustc_ast" ,
35353534 " rustc_data_structures" ,
35363535 " rustc_index" ,
Original file line number Diff line number Diff line change @@ -15,6 +15,5 @@ rustc_index = { path = "../rustc_index" }
1515rustc_span = { path = " ../rustc_span" }
1616rustc_serialize = { path = " ../rustc_serialize" }
1717rustc_ast = { path = " ../rustc_ast" }
18- lazy_static = " 1"
1918tracing = " 0.1"
2019smallvec = { version = " 1.0" , features = [" union" , " may_dangle" ] }
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ use rustc_macros::HashStable_Generic;
1717use rustc_span:: symbol:: { kw, sym, Symbol } ;
1818use rustc_span:: Span ;
1919
20- use lazy_static :: lazy_static ;
20+ use std :: lazy :: SyncLazy ;
2121
2222pub enum LangItemGroup {
2323 Op ,
@@ -117,14 +117,12 @@ macro_rules! language_item_table {
117117 ) *
118118 }
119119
120- lazy_static! {
121- /// A mapping from the name of the lang item to its order and the form it must be of.
122- pub static ref ITEM_REFS : FxHashMap <Symbol , ( usize , Target ) > = {
123- let mut item_refs = FxHashMap :: default ( ) ;
124- $( item_refs. insert( $name, ( LangItem :: $variant as usize , $target) ) ; ) *
125- item_refs
126- } ;
127- }
120+ /// A mapping from the name of the lang item to its order and the form it must be of.
121+ pub static ITEM_REFS : SyncLazy <FxHashMap <Symbol , ( usize , Target ) >> = SyncLazy :: new( || {
122+ let mut item_refs = FxHashMap :: default ( ) ;
123+ $( item_refs. insert( $name, ( LangItem :: $variant as usize , $target) ) ; ) *
124+ item_refs
125+ } ) ;
128126
129127// End of the macro
130128 }
Original file line number Diff line number Diff line change 66#![ feature( const_fn) ] // For the unsizing cast on `&[]`
77#![ feature( const_panic) ]
88#![ feature( in_band_lifetimes) ]
9+ #![ feature( once_cell) ]
910#![ feature( or_patterns) ]
1011#![ recursion_limit = "256" ]
1112
Original file line number Diff line number Diff line change @@ -7,18 +7,16 @@ use rustc_ast as ast;
77use rustc_data_structures:: fx:: FxHashMap ;
88use rustc_span:: symbol:: { sym, Symbol } ;
99
10- use lazy_static :: lazy_static ;
10+ use std :: lazy :: SyncLazy ;
1111
1212macro_rules! weak_lang_items {
1313 ( $( $name: ident, $item: ident, $sym: ident; ) * ) => (
1414
15- lazy_static! {
16- pub static ref WEAK_ITEMS_REFS : FxHashMap <Symbol , LangItem > = {
17- let mut map = FxHashMap :: default ( ) ;
18- $( map. insert( sym:: $name, LangItem :: $item) ; ) *
19- map
20- } ;
21- }
15+ pub static WEAK_ITEMS_REFS : SyncLazy <FxHashMap <Symbol , LangItem >> = SyncLazy :: new( || {
16+ let mut map = FxHashMap :: default ( ) ;
17+ $( map. insert( sym:: $name, LangItem :: $item) ; ) *
18+ map
19+ } ) ;
2220
2321/// The `check_name` argument avoids the need for `librustc_hir` to depend on
2422/// `librustc_session`.
You can’t perform that action at this time.
0 commit comments