diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-03-21 11:40:13 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-03-21 11:50:40 +1100 |
| commit | 5744be2727a7ebc7726a6e23d517a41cc1e8ffe2 (patch) | |
| tree | 99b0375318281d8ec09e51664fabc12e7637c9c6 | |
| parent | 23ee523ea61355c332481566bb5a093f29cdce59 (diff) | |
| download | rust-5744be2727a7ebc7726a6e23d517a41cc1e8ffe2.tar.gz rust-5744be2727a7ebc7726a6e23d517a41cc1e8ffe2.zip | |
Rename some `target_cfg` variables as `target`.
Because the underlying type is called `Target`. (There is also a separate type called `TargetCfg`.)
| -rw-r--r-- | compiler/rustc_interface/src/tests.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_session/src/session.rs | 9 |
2 files changed, 6 insertions, 7 deletions
diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs index c796448e5ee..8a27e9a6453 100644 --- a/compiler/rustc_interface/src/tests.rs +++ b/compiler/rustc_interface/src/tests.rs @@ -41,7 +41,7 @@ fn mk_session(matches: getopts::Matches) -> (Session, Cfg) { let sysroot = filesearch::materialize_sysroot(sessopts.maybe_sysroot.clone()); - let target_cfg = rustc_session::config::build_target_config(&early_dcx, &sessopts, &sysroot); + let target = rustc_session::config::build_target_config(&early_dcx, &sessopts, &sysroot); let sess = build_session( early_dcx, @@ -52,7 +52,7 @@ fn mk_session(matches: getopts::Matches) -> (Session, Cfg) { vec![], Default::default(), None, - target_cfg, + target, sysroot, "", None, diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 9c94fd7027f..e6d82d6fab3 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -1008,7 +1008,7 @@ pub fn build_session( fluent_resources: Vec<&'static str>, driver_lint_caps: FxHashMap<lint::LintId, lint::Level>, file_loader: Option<Box<dyn FileLoader + Send + Sync + 'static>>, - target_cfg: Target, + target: Target, sysroot: PathBuf, cfg_version: &'static str, ice_file: Option<PathBuf>, @@ -1036,7 +1036,7 @@ pub fn build_session( let loader = file_loader.unwrap_or_else(|| Box::new(RealFileLoader)); let hash_kind = sopts.unstable_opts.src_hash_algorithm.unwrap_or_else(|| { - if target_cfg.is_like_msvc { + if target.is_like_msvc { SourceFileHashAlgorithm::Sha256 } else { SourceFileHashAlgorithm::Md5 @@ -1117,11 +1117,10 @@ pub fn build_session( _ => CtfeBacktrace::Disabled, }); - let asm_arch = - if target_cfg.allow_asm { InlineAsmArch::from_str(&target_cfg.arch).ok() } else { None }; + let asm_arch = if target.allow_asm { InlineAsmArch::from_str(&target.arch).ok() } else { None }; let sess = Session { - target: target_cfg, + target, host, opts: sopts, host_tlib_path, |
