Skip to content

Commit 65ae469

Browse files
Rollup merge of #78875 - petrochenkov:cleantarg, r=Mark-Simulacrum
rustc_target: Further cleanup use of target options Follow up to rust-lang/rust#77729. Implements items 2 and 4 from the list in rust-lang/rust#77729 (comment). The first commit collapses uses of `target.options.foo` into `target.foo`. The second commit renames some target options to avoid tautology: `target.target_endian` -> `target.endian` `target.target_c_int_width` -> `target.c_int_width` `target.target_os` -> `target.os` `target.target_env` -> `target.env` `target.target_vendor` -> `target.vendor` `target.target_family` -> `target.os_family` `target.target_mcount` -> `target.mcount` r? `@Mark-Simulacrum`
2 parents 806538f + e9c34b3 commit 65ae469

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/archive.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
6363
sess,
6464
dst: output.to_path_buf(),
6565
lib_search_paths: archive_search_paths(sess),
66-
use_gnu_style_archive: sess.target.options.archive_format == "gnu",
66+
use_gnu_style_archive: sess.target.archive_format == "gnu",
6767
// FIXME fix builtin ranlib on macOS
68-
no_builtin_ranlib: sess.target.options.is_like_osx,
68+
no_builtin_ranlib: sess.target.is_like_osx,
6969

7070
src_archives,
7171
entries,

src/debuginfo/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl<'tcx> DebugContext<'tcx> {
5050
// TODO: this should be configurable
5151
// macOS doesn't seem to support DWARF > 3
5252
// 5 version is required for md5 file hash
53-
version: if tcx.sess.target.options.is_like_osx {
53+
version: if tcx.sess.target.is_like_osx {
5454
3
5555
} else {
5656
// FIXME change to version 5 once the gdb and lldb shipping with the latest debian

src/driver/aot.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ fn codegen_global_asm(tcx: TyCtxt<'_>, cgu_name: &str, global_asm: &str) {
320320
}
321321

322322
if cfg!(not(feature = "inline_asm"))
323-
|| tcx.sess.target.options.is_like_osx
324-
|| tcx.sess.target.options.is_like_windows
323+
|| tcx.sess.target.is_like_osx
324+
|| tcx.sess.target.is_like_windows
325325
{
326326
if global_asm.contains("__rust_probestack") {
327327
return;

src/metadata.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub(crate) fn write_metadata<P: WriteMetadata>(
101101
product.add_rustc_section(
102102
rustc_middle::middle::exported_symbols::metadata_symbol_name(tcx),
103103
compressed,
104-
tcx.sess.target.options.is_like_osx,
104+
tcx.sess.target.is_like_osx,
105105
);
106106

107107
metadata

src/toolchain.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ fn linker_and_flavor(sess: &Session) -> (PathBuf, LinkerFlavor) {
9191
} else if stem == "link" || stem == "lld-link" {
9292
LinkerFlavor::Msvc
9393
} else if stem == "lld" || stem == "rust-lld" {
94-
LinkerFlavor::Lld(sess.target.options.lld_flavor)
94+
LinkerFlavor::Lld(sess.target.lld_flavor)
9595
} else {
9696
// fall back to the value in the target spec
9797
sess.target.linker_flavor
@@ -115,7 +115,7 @@ fn linker_and_flavor(sess: &Session) -> (PathBuf, LinkerFlavor) {
115115

116116
if let Some(ret) = infer_from(
117117
sess,
118-
sess.target.options.linker.clone().map(PathBuf::from),
118+
sess.target.linker.clone().map(PathBuf::from),
119119
Some(sess.target.linker_flavor),
120120
) {
121121
return ret;

0 commit comments

Comments
 (0)