@@ -1247,8 +1247,8 @@ pub const fn default_lib_output() -> CrateType {
12471247 CrateType :: Rlib
12481248}
12491249
1250- fn default_configuration ( sess : & Session ) -> Cfg < Symbol > {
1251- // NOTE: This should be kept in sync with `CheckCfg::<Symbol>:: fill_well_known` below.
1250+ fn default_configuration ( sess : & Session ) -> Cfg {
1251+ // NOTE: This should be kept in sync with `CheckCfg::fill_well_known` below.
12521252 let end = & sess. target . endian ;
12531253 let arch = & sess. target . arch ;
12541254 let wordsz = sess. target . pointer_width . to_string ( ) ;
@@ -1358,32 +1358,21 @@ fn default_configuration(sess: &Session) -> Cfg<Symbol> {
13581358}
13591359
13601360/// The parsed `--cfg` options that define the compilation environment of the
1361- /// crate, used to drive conditional compilation. `T` is always `String` or
1362- /// `Symbol`. Strings are used temporarily very early on. Once the the main
1363- /// symbol interner is running, they are converted to symbols.
1361+ /// crate, used to drive conditional compilation.
13641362///
13651363/// An `FxIndexSet` is used to ensure deterministic ordering of error messages
13661364/// relating to `--cfg`.
1367- pub type Cfg < T > = FxIndexSet < ( T , Option < T > ) > ;
1365+ pub type Cfg = FxIndexSet < ( Symbol , Option < Symbol > ) > ;
13681366
1369- /// The parsed `--check-cfg` options. The `<T>` structure is similar to `Cfg`.
1370- pub struct CheckCfg < T > {
1367+ /// The parsed `--check-cfg` options.
1368+ #[ derive( Default ) ]
1369+ pub struct CheckCfg {
13711370 /// Is well known names activated
13721371 pub exhaustive_names : bool ,
13731372 /// Is well known values activated
13741373 pub exhaustive_values : bool ,
13751374 /// All the expected values for a config name
1376- pub expecteds : FxHashMap < T , ExpectedValues < T > > ,
1377- }
1378-
1379- impl < T > Default for CheckCfg < T > {
1380- fn default ( ) -> Self {
1381- CheckCfg {
1382- exhaustive_names : false ,
1383- exhaustive_values : false ,
1384- expecteds : FxHashMap :: default ( ) ,
1385- }
1386- }
1375+ pub expecteds : FxHashMap < Symbol , ExpectedValues < Symbol > > ,
13871376}
13881377
13891378pub enum ExpectedValues < T > {
@@ -1418,7 +1407,7 @@ impl<'a, T: Eq + Hash + Copy + 'a> Extend<&'a T> for ExpectedValues<T> {
14181407 }
14191408}
14201409
1421- impl CheckCfg < Symbol > {
1410+ impl CheckCfg {
14221411 pub fn fill_well_known ( & mut self , current_target : & Target ) {
14231412 if !self . exhaustive_values && !self . exhaustive_names {
14241413 return ;
@@ -1558,7 +1547,7 @@ impl CheckCfg<Symbol> {
15581547 }
15591548}
15601549
1561- pub fn build_configuration ( sess : & Session , mut user_cfg : Cfg < Symbol > ) -> Cfg < Symbol > {
1550+ pub fn build_configuration ( sess : & Session , mut user_cfg : Cfg ) -> Cfg {
15621551 // Combine the configuration requested by the session (command line) with
15631552 // some default and generated configuration items.
15641553 let default_cfg = default_configuration ( sess) ;
0 commit comments