@@ -1518,37 +1518,32 @@ impl<'a> NameBinding<'a> {
15181518///
15191519/// All other types are defined somewhere and possibly imported, but the primitive ones need
15201520/// special handling, since they have no place of origin.
1521- #[ derive( Default ) ]
15221521struct PrimitiveTypeTable {
15231522 primitive_types : FxHashMap < Name , PrimTy > ,
15241523}
15251524
15261525impl PrimitiveTypeTable {
15271526 fn new ( ) -> PrimitiveTypeTable {
1528- let mut table = PrimitiveTypeTable :: default ( ) ;
1529-
1530- table. intern ( "bool" , Bool ) ;
1531- table. intern ( "char" , Char ) ;
1532- table. intern ( "f32" , Float ( FloatTy :: F32 ) ) ;
1533- table. intern ( "f64" , Float ( FloatTy :: F64 ) ) ;
1534- table. intern ( "isize" , Int ( IntTy :: Isize ) ) ;
1535- table. intern ( "i8" , Int ( IntTy :: I8 ) ) ;
1536- table. intern ( "i16" , Int ( IntTy :: I16 ) ) ;
1537- table. intern ( "i32" , Int ( IntTy :: I32 ) ) ;
1538- table. intern ( "i64" , Int ( IntTy :: I64 ) ) ;
1539- table. intern ( "i128" , Int ( IntTy :: I128 ) ) ;
1540- table. intern ( "str" , Str ) ;
1541- table. intern ( "usize" , Uint ( UintTy :: Usize ) ) ;
1542- table. intern ( "u8" , Uint ( UintTy :: U8 ) ) ;
1543- table. intern ( "u16" , Uint ( UintTy :: U16 ) ) ;
1544- table. intern ( "u32" , Uint ( UintTy :: U32 ) ) ;
1545- table. intern ( "u64" , Uint ( UintTy :: U64 ) ) ;
1546- table. intern ( "u128" , Uint ( UintTy :: U128 ) ) ;
1547- table
1548- }
1549-
1550- fn intern ( & mut self , string : & str , primitive_type : PrimTy ) {
1551- self . primitive_types . insert ( Symbol :: intern ( string) , primitive_type) ;
1527+ let mut table = FxHashMap :: default ( ) ;
1528+
1529+ table. insert ( sym:: bool, Bool ) ;
1530+ table. insert ( sym:: char, Char ) ;
1531+ table. insert ( sym:: f32, Float ( FloatTy :: F32 ) ) ;
1532+ table. insert ( sym:: f64, Float ( FloatTy :: F64 ) ) ;
1533+ table. insert ( sym:: isize, Int ( IntTy :: Isize ) ) ;
1534+ table. insert ( sym:: i8, Int ( IntTy :: I8 ) ) ;
1535+ table. insert ( sym:: i16, Int ( IntTy :: I16 ) ) ;
1536+ table. insert ( sym:: i32, Int ( IntTy :: I32 ) ) ;
1537+ table. insert ( sym:: i64, Int ( IntTy :: I64 ) ) ;
1538+ table. insert ( sym:: i128, Int ( IntTy :: I128 ) ) ;
1539+ table. insert ( sym:: str, Str ) ;
1540+ table. insert ( sym:: usize, Uint ( UintTy :: Usize ) ) ;
1541+ table. insert ( sym:: u8, Uint ( UintTy :: U8 ) ) ;
1542+ table. insert ( sym:: u16, Uint ( UintTy :: U16 ) ) ;
1543+ table. insert ( sym:: u32, Uint ( UintTy :: U32 ) ) ;
1544+ table. insert ( sym:: u64, Uint ( UintTy :: U64 ) ) ;
1545+ table. insert ( sym:: u128, Uint ( UintTy :: U128 ) ) ;
1546+ Self { primitive_types : table }
15521547 }
15531548}
15541549
0 commit comments