Skip to content

Commit

Permalink
Rename some target_cfg variables as target.
Browse files Browse the repository at this point in the history
Because the underlying type is called `Target`. (There is also a
separate type called `TargetCfg`.)
  • Loading branch information
nnethercote committed Mar 21, 2024
1 parent 23ee523 commit 5744be2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_interface/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -52,7 +52,7 @@ fn mk_session(matches: getopts::Matches) -> (Session, Cfg) {
vec![],
Default::default(),
None,
target_cfg,
target,
sysroot,
"",
None,
Expand Down
9 changes: 4 additions & 5 deletions compiler/rustc_session/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 5744be2

Please sign in to comment.