diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2022-06-24 16:43:45 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-24 16:43:45 +0900 |
| commit | 33eb3c05c54b306afea341dd233671a9f039156f (patch) | |
| tree | 381a02063b8b78dc7b5de4b1dc40d4c90fa65030 /compiler/rustc_codegen_ssa/src | |
| parent | 6580d7e784d0046ab2f8d43dac36ea0de0139978 (diff) | |
| parent | 37fd2941a1290a287935988641dc14233ee5e236 (diff) | |
| download | rust-33eb3c05c54b306afea341dd233671a9f039156f.tar.gz rust-33eb3c05c54b306afea341dd233671a9f039156f.zip | |
Rollup merge of #98214 - petrochenkov:islike, r=compiler-errors
rustc_target: Remove some redundant target properties
`is_like_emscripten` is equivalent to `os == "emscripten"`, so it's removed.
`is_like_fuchsia` is equivalent to `os == "fuchsia"`, so it's removed.
`is_like_osx` also falls into the same category and is equivalent to `vendor == "apple"`, but it's commonly used so I kept it as is for now.
`is_like_(solaris,windows,wasm)` are combinations of different operating systems or architectures (see compiler/rustc_target/src/spec/tests/tests_impl.rs) so they are also kept as is.
I think `is_like_wasm` (and maybe `is_like_osx`) are sufficiently closed sets, so we can remove these fields as well and replace them with methods like `fn is_like_wasm() { arch == "wasm32" || arch == "wasm64" }`.
On other hand, `is_like_solaris` and `is_like_windows` are sufficiently open and I can imagine custom targets introducing other values for `os`.
This is kind of a gray area.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/link.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index edf49b8c80e..72aa790c363 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -2031,7 +2031,7 @@ fn add_order_independent_options( add_link_script(cmd, sess, tmpdir, crate_type); - if sess.target.is_like_fuchsia && crate_type == CrateType::Executable { + if sess.target.os == "fuchsia" && crate_type == CrateType::Executable { let prefix = if sess.opts.debugging_opts.sanitizer.contains(SanitizerSet::ADDRESS) { "asan/" } else { @@ -2051,7 +2051,7 @@ fn add_order_independent_options( cmd.no_crt_objects(); } - if sess.target.is_like_emscripten { + if sess.target.os == "emscripten" { cmd.arg("-s"); cmd.arg(if sess.panic_strategy() == PanicStrategy::Abort { "DISABLE_EXCEPTION_CATCHING=1" |
