@@ -1247,8 +1247,8 @@ pub const fn default_lib_output() -> CrateType {
1247
1247
CrateType :: Rlib
1248
1248
}
1249
1249
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.
1252
1252
let end = & sess. target . endian ;
1253
1253
let arch = & sess. target . arch ;
1254
1254
let wordsz = sess. target . pointer_width . to_string ( ) ;
@@ -1358,32 +1358,21 @@ fn default_configuration(sess: &Session) -> Cfg<Symbol> {
1358
1358
}
1359
1359
1360
1360
/// 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.
1364
1362
///
1365
1363
/// An `FxIndexSet` is used to ensure deterministic ordering of error messages
1366
1364
/// relating to `--cfg`.
1367
- pub type Cfg < T > = FxIndexSet < ( T , Option < T > ) > ;
1365
+ pub type Cfg = FxIndexSet < ( Symbol , Option < Symbol > ) > ;
1368
1366
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 {
1371
1370
/// Is well known names activated
1372
1371
pub exhaustive_names : bool ,
1373
1372
/// Is well known values activated
1374
1373
pub exhaustive_values : bool ,
1375
1374
/// 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 > > ,
1387
1376
}
1388
1377
1389
1378
pub enum ExpectedValues < T > {
@@ -1418,7 +1407,7 @@ impl<'a, T: Eq + Hash + Copy + 'a> Extend<&'a T> for ExpectedValues<T> {
1418
1407
}
1419
1408
}
1420
1409
1421
- impl CheckCfg < Symbol > {
1410
+ impl CheckCfg {
1422
1411
pub fn fill_well_known ( & mut self , current_target : & Target ) {
1423
1412
if !self . exhaustive_values && !self . exhaustive_names {
1424
1413
return ;
@@ -1558,7 +1547,7 @@ impl CheckCfg<Symbol> {
1558
1547
}
1559
1548
}
1560
1549
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 {
1562
1551
// Combine the configuration requested by the session (command line) with
1563
1552
// some default and generated configuration items.
1564
1553
let default_cfg = default_configuration ( sess) ;
0 commit comments