Skip to content

Commit b0c9708

Browse files
committed
Auto merge of #148851 - Zalathar:rollup-4y7ywyd, r=Zalathar
Rollup of 16 pull requests Successful merges: - rust-lang/rust#146627 (Simplify `jemalloc` setup) - rust-lang/rust#147753 (Suggest add bounding value for RangeTo) - rust-lang/rust#147832 (rustdoc: Don't pass `RenderOptions` to `DocContext`) - rust-lang/rust#147974 (Improve diagnostics for buffer reuse with borrowed references) - rust-lang/rust#148080 ([rustdoc] Fix invalid jump to def macro link generation) - rust-lang/rust#148465 (Adjust spans into the `for` loops context before creating the new desugaring spans.) - rust-lang/rust#148500 (Update git index before running diff-index) - rust-lang/rust#148531 (rustc_target: introduce Abi, Env, Os) - rust-lang/rust#148536 (cmse: add test for `async` and `const` functions) - rust-lang/rust#148770 (implement `feature(c_variadic_naked_functions)`) - rust-lang/rust#148780 (fix filecheck typos in tests) - rust-lang/rust#148819 (Remove specialized warning for removed target) - rust-lang/rust#148830 (miri subtree update) - rust-lang/rust#148833 (Update rustbook dependencies) - rust-lang/rust#148834 (fix(rustdoc): Color doctest errors) - rust-lang/rust#148841 (Remove more `#[must_use]` from portable-simd) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 6a2d1e3 + 0140f7f commit b0c9708

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
4949
use rustc_session::Session;
5050
use rustc_session::config::OutputFilenames;
5151
use rustc_span::{Symbol, sym};
52-
use rustc_target::spec::Arch;
52+
use rustc_target::spec::{Abi, Arch, Env, Os};
5353

5454
pub use crate::config::*;
5555
use crate::prelude::*;
@@ -163,15 +163,15 @@ impl CodegenBackend for CraneliftCodegenBackend {
163163
fn target_config(&self, sess: &Session) -> TargetConfig {
164164
// FIXME return the actually used target features. this is necessary for #[cfg(target_feature)]
165165
let target_features = match sess.target.arch {
166-
Arch::X86_64 if sess.target.os != "none" => {
166+
Arch::X86_64 if sess.target.os != Os::None => {
167167
// x86_64 mandates SSE2 support and rustc requires the x87 feature to be enabled
168168
vec![sym::fxsr, sym::sse, sym::sse2, Symbol::intern("x87")]
169169
}
170-
Arch::AArch64 => match &*sess.target.os {
171-
"none" => vec![],
170+
Arch::AArch64 => match &sess.target.os {
171+
Os::None => vec![],
172172
// On macOS the aes, sha2 and sha3 features are enabled by default and ring
173173
// fails to compile on macOS when they are not present.
174-
"macos" => vec![sym::neon, sym::aes, sym::sha2, sym::sha3],
174+
Os::MacOs => vec![sym::neon, sym::aes, sym::sha2, sym::sha3],
175175
// AArch64 mandates Neon support
176176
_ => vec![sym::neon],
177177
},
@@ -184,9 +184,9 @@ impl CodegenBackend for CraneliftCodegenBackend {
184184
// targets due to GCC using a different ABI than LLVM. Therefore `f16` and `f128`
185185
// won't be available when using a LLVM-built sysroot.
186186
let has_reliable_f16_f128 = !(sess.target.arch == Arch::X86_64
187-
&& sess.target.os == "windows"
188-
&& sess.target.env == "gnu"
189-
&& sess.target.abi != "llvm");
187+
&& sess.target.os == Os::Windows
188+
&& sess.target.env == Env::Gnu
189+
&& sess.target.abi != Abi::Llvm);
190190

191191
TargetConfig {
192192
target_features,

0 commit comments

Comments
 (0)