Skip to content

Commit fc2165d

Browse files
committed
Auto merge of #2048 - RalfJung:rustup, r=RalfJung
rustup
2 parents 732461b + 830cc58 commit fc2165d

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
297a8018b525c28ef10ee6a91d61954839b508b9
1+
6af09d2505f38e4f1df291df56d497fb2ad935ed

src/helpers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
510510
let this = self.eval_context_mut();
511511
let target = &this.tcx.sess.target;
512512
let target_os = &target.os;
513-
let last_error = if target.families.contains(&"unix".to_owned()) {
513+
let last_error = if target.families.iter().any(|f| f == "unix") {
514514
this.eval_libc(match err_kind {
515515
ConnectionRefused => "ECONNREFUSED",
516516
ConnectionReset => "ECONNRESET",
@@ -534,7 +534,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
534534
)
535535
}
536536
})?
537-
} else if target.families.contains(&"windows".to_owned()) {
537+
} else if target.families.iter().any(|f| f == "windows") {
538538
// FIXME: we have to finish implementing the Windows equivalent of this.
539539
this.eval_windows(
540540
"c",

src/machine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ impl MemoryExtra {
227227
pub fn init_extern_statics<'tcx, 'mir>(
228228
this: &mut MiriEvalContext<'mir, 'tcx>,
229229
) -> InterpResult<'tcx> {
230-
match this.tcx.sess.target.os.as_str() {
230+
match this.tcx.sess.target.os.as_ref() {
231231
"linux" => {
232232
// "environ"
233233
Self::add_extern_static(

src/shims/env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl<'tcx> EnvVars<'tcx> {
4141
mut excluded_env_vars: Vec<String>,
4242
forwarded_env_vars: Vec<String>,
4343
) -> InterpResult<'tcx> {
44-
let target_os = ecx.tcx.sess.target.os.as_str();
44+
let target_os = ecx.tcx.sess.target.os.as_ref();
4545
// HACK: Exclude `TERM` var to avoid terminfo trying to open the termcap file.
4646
// This is (a) very slow and (b) does not work on Windows.
4747
excluded_env_vars.push("TERM".to_owned());

src/shims/foreign_items.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
4646
fn min_align(&self, size: u64, kind: MiriMemoryKind) -> Align {
4747
let this = self.eval_context_ref();
4848
// List taken from `libstd/sys_common/alloc.rs`.
49-
let min_align = match this.tcx.sess.target.arch.as_str() {
49+
let min_align = match this.tcx.sess.target.arch.as_ref() {
5050
"x86" | "arm" | "mips" | "powerpc" | "powerpc64" | "asmjs" | "wasm32" => 8,
5151
"x86_64" | "aarch64" | "mips64" | "s390x" | "sparc64" => 16,
5252
arch => bug!("Unsupported target architecture: {}", arch),
@@ -695,7 +695,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
695695
}
696696

697697
// Platform-specific shims
698-
_ => match this.tcx.sess.target.os.as_str() {
698+
_ => match this.tcx.sess.target.os.as_ref() {
699699
"linux" | "macos" => return shims::posix::foreign_items::EvalContextExt::emulate_foreign_item_by_name(this, link_name, abi, args, dest, ret),
700700
"windows" => return shims::windows::foreign_items::EvalContextExt::emulate_foreign_item_by_name(this, link_name, abi, args, dest, ret),
701701
target => throw_unsup_format!("the target `{}` is not supported", target),

src/shims/posix/foreign_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
462462

463463
// Platform-specific shims
464464
_ => {
465-
match this.tcx.sess.target.os.as_str() {
465+
match this.tcx.sess.target.os.as_ref() {
466466
"linux" => return shims::posix::linux::foreign_items::EvalContextExt::emulate_foreign_item_by_name(this, link_name, abi, args, dest, ret),
467467
"macos" => return shims::posix::macos::foreign_items::EvalContextExt::emulate_foreign_item_by_name(this, link_name, abi, args, dest, ret),
468468
_ => unreachable!(),

0 commit comments

Comments
 (0)