Skip to content

Commit 5744be2

Browse files
committed
Rename some target_cfg variables as target.
Because the underlying type is called `Target`. (There is also a separate type called `TargetCfg`.)
1 parent 23ee523 commit 5744be2

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

compiler/rustc_interface/src/tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fn mk_session(matches: getopts::Matches) -> (Session, Cfg) {
4141

4242
let sysroot = filesearch::materialize_sysroot(sessopts.maybe_sysroot.clone());
4343

44-
let target_cfg = rustc_session::config::build_target_config(&early_dcx, &sessopts, &sysroot);
44+
let target = rustc_session::config::build_target_config(&early_dcx, &sessopts, &sysroot);
4545

4646
let sess = build_session(
4747
early_dcx,
@@ -52,7 +52,7 @@ fn mk_session(matches: getopts::Matches) -> (Session, Cfg) {
5252
vec![],
5353
Default::default(),
5454
None,
55-
target_cfg,
55+
target,
5656
sysroot,
5757
"",
5858
None,

compiler/rustc_session/src/session.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ pub fn build_session(
10081008
fluent_resources: Vec<&'static str>,
10091009
driver_lint_caps: FxHashMap<lint::LintId, lint::Level>,
10101010
file_loader: Option<Box<dyn FileLoader + Send + Sync + 'static>>,
1011-
target_cfg: Target,
1011+
target: Target,
10121012
sysroot: PathBuf,
10131013
cfg_version: &'static str,
10141014
ice_file: Option<PathBuf>,
@@ -1036,7 +1036,7 @@ pub fn build_session(
10361036

10371037
let loader = file_loader.unwrap_or_else(|| Box::new(RealFileLoader));
10381038
let hash_kind = sopts.unstable_opts.src_hash_algorithm.unwrap_or_else(|| {
1039-
if target_cfg.is_like_msvc {
1039+
if target.is_like_msvc {
10401040
SourceFileHashAlgorithm::Sha256
10411041
} else {
10421042
SourceFileHashAlgorithm::Md5
@@ -1117,11 +1117,10 @@ pub fn build_session(
11171117
_ => CtfeBacktrace::Disabled,
11181118
});
11191119

1120-
let asm_arch =
1121-
if target_cfg.allow_asm { InlineAsmArch::from_str(&target_cfg.arch).ok() } else { None };
1120+
let asm_arch = if target.allow_asm { InlineAsmArch::from_str(&target.arch).ok() } else { None };
11221121

11231122
let sess = Session {
1124-
target: target_cfg,
1123+
target,
11251124
host,
11261125
opts: sopts,
11271126
host_tlib_path,

0 commit comments

Comments
 (0)