diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-10-30 14:01:33 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-10-30 14:12:51 +1100 |
| commit | 8e4ac980fd775d311bc63642c8d6b5739aa6f34c (patch) | |
| tree | 54231b347b380fe1ae9ae675b9920b17e3d9e843 /compiler/rustc_session | |
| parent | bfcff7933e9be5c9ff31854896e9582b84b19d36 (diff) | |
| download | rust-8e4ac980fd775d311bc63642c8d6b5739aa6f34c.tar.gz rust-8e4ac980fd775d311bc63642c8d6b5739aa6f34c.zip | |
Change cfg parsers to produce symbols instead of strings.
Diffstat (limited to 'compiler/rustc_session')
| -rw-r--r-- | compiler/rustc_session/src/config.rs | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index 854e2b77993..4a0bdd511a3 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -1386,30 +1386,6 @@ impl<T> Default for CheckCfg<T> { } } -impl CheckCfg<String> { - pub fn intern(self) -> CheckCfg<Symbol> { - CheckCfg { - exhaustive_names: self.exhaustive_names, - exhaustive_values: self.exhaustive_values, - expecteds: self - .expecteds - .into_iter() - .map(|(name, values)| { - ( - Symbol::intern(&name), - match values { - ExpectedValues::Some(values) => ExpectedValues::Some( - values.into_iter().map(|b| b.map(|b| Symbol::intern(&b))).collect(), - ), - ExpectedValues::Any => ExpectedValues::Any, - }, - ) - }) - .collect(), - } - } -} - pub enum ExpectedValues<T> { Some(FxHashSet<Option<T>>), Any, @@ -1582,13 +1558,7 @@ impl CheckCfg<Symbol> { } } -pub fn build_configuration(sess: &Session, user_cfg: Cfg<String>) -> Cfg<Symbol> { - // We can now intern these strings. - let mut user_cfg: Cfg<Symbol> = user_cfg - .into_iter() - .map(|(a, b)| (Symbol::intern(&a), b.map(|b| Symbol::intern(&b)))) - .collect(); - +pub fn build_configuration(sess: &Session, mut user_cfg: Cfg<Symbol>) -> Cfg<Symbol> { // Combine the configuration requested by the session (command line) with // some default and generated configuration items. let default_cfg = default_configuration(sess); |
