From 43673d9a87200f55423c01e85e108c2c9cfcefcb Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 11 Nov 2020 10:29:10 +0100 Subject: [PATCH] rustup --- rust-version | 2 +- src/helpers.rs | 6 +++--- src/machine.rs | 2 +- src/shims/env.rs | 12 ++++++------ src/shims/foreign_items.rs | 2 +- src/shims/os_str.rs | 2 +- src/shims/posix/foreign_items.rs | 4 ++-- src/shims/posix/fs.rs | 4 ++-- src/shims/posix/linux/dlsym.rs | 2 +- src/shims/posix/macos/dlsym.rs | 2 +- src/shims/tls.rs | 2 +- src/shims/windows/dlsym.rs | 2 +- src/shims/windows/foreign_items.rs | 2 +- 13 files changed, 22 insertions(+), 22 deletions(-) diff --git a/rust-version b/rust-version index c6a3130a5a4..e19cca38c04 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -cf9cf7c923eb01146971429044f216a3ca905e06 +38030ffb4e735b26260848b744c0910a5641e1db diff --git a/src/helpers.rs b/src/helpers.rs index a13d9b4519b..4c989db0170 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -387,7 +387,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx /// if this is not the case. fn assert_target_os(&self, target_os: &str, name: &str) { assert_eq!( - self.eval_context_ref().tcx.sess.target.target_os, + self.eval_context_ref().tcx.sess.target.os, target_os, "`{}` is only available on the `{}` target OS", name, @@ -431,8 +431,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx use std::io::ErrorKind::*; let this = self.eval_context_mut(); let target = &this.tcx.sess.target; - let target_os = &target.target_os; - let last_error = if target.options.target_family == Some("unix".to_owned()) { + let target_os = &target.os; + let last_error = if target.os_family == Some("unix".to_owned()) { this.eval_libc(match e.kind() { ConnectionRefused => "ECONNREFUSED", ConnectionReset => "ECONNRESET", diff --git a/src/machine.rs b/src/machine.rs index e9f9298e566..2537956228a 100644 --- a/src/machine.rs +++ b/src/machine.rs @@ -172,7 +172,7 @@ impl MemoryExtra { pub fn init_extern_statics<'tcx, 'mir>( this: &mut MiriEvalContext<'mir, 'tcx>, ) -> InterpResult<'tcx> { - match this.tcx.sess.target.target_os.as_str() { + match this.tcx.sess.target.os.as_str() { "linux" => { // "__cxa_thread_atexit_impl" // This should be all-zero, pointer-sized. diff --git a/src/shims/env.rs b/src/shims/env.rs index 2db64ad5a14..12d1cda96da 100644 --- a/src/shims/env.rs +++ b/src/shims/env.rs @@ -38,7 +38,7 @@ impl<'tcx> EnvVars<'tcx> { ecx: &mut InterpCx<'mir, 'tcx, Evaluator<'mir, 'tcx>>, mut excluded_env_vars: Vec, ) -> InterpResult<'tcx> { - let target_os = ecx.tcx.sess.target.target_os.as_str(); + let target_os = ecx.tcx.sess.target.os.as_str(); if target_os == "windows" { // Temporary hack: Exclude `TERM` var to avoid terminfo trying to open the termcap file. // Can be removed once https://github.com/rust-lang/miri/issues/1013 is resolved. @@ -101,7 +101,7 @@ impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriEvalContext<'mi pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx> { fn getenv(&mut self, name_op: OpTy<'tcx, Tag>) -> InterpResult<'tcx, Scalar> { let this = self.eval_context_mut(); - let target_os = &this.tcx.sess.target.target_os; + let target_os = &this.tcx.sess.target.os; assert!(target_os == "linux" || target_os == "macos", "`getenv` is only available for the UNIX target family"); let name_ptr = this.read_scalar(name_op)?.check_init()?; @@ -185,7 +185,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx value_op: OpTy<'tcx, Tag>, ) -> InterpResult<'tcx, i32> { let mut this = self.eval_context_mut(); - let target_os = &this.tcx.sess.target.target_os; + let target_os = &this.tcx.sess.target.os; assert!(target_os == "linux" || target_os == "macos", "`setenv` is only available for the UNIX target family"); let name_ptr = this.read_scalar(name_op)?.check_init()?; @@ -258,7 +258,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx fn unsetenv(&mut self, name_op: OpTy<'tcx, Tag>) -> InterpResult<'tcx, i32> { let this = self.eval_context_mut(); - let target_os = &this.tcx.sess.target.target_os; + let target_os = &this.tcx.sess.target.os; assert!(target_os == "linux" || target_os == "macos", "`unsetenv` is only available for the UNIX target family"); let name_ptr = this.read_scalar(name_op)?.check_init()?; @@ -290,7 +290,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx size_op: OpTy<'tcx, Tag>, ) -> InterpResult<'tcx, Scalar> { let this = self.eval_context_mut(); - let target_os = &this.tcx.sess.target.target_os; + let target_os = &this.tcx.sess.target.os; assert!(target_os == "linux" || target_os == "macos", "`getcwd` is only available for the UNIX target family"); this.check_no_isolation("`getcwd`")?; @@ -336,7 +336,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx fn chdir(&mut self, path_op: OpTy<'tcx, Tag>) -> InterpResult<'tcx, i32> { let this = self.eval_context_mut(); - let target_os = &this.tcx.sess.target.target_os; + let target_os = &this.tcx.sess.target.os; assert!(target_os == "linux" || target_os == "macos", "`getcwd` is only available for the UNIX target family"); this.check_no_isolation("`chdir`")?; diff --git a/src/shims/foreign_items.rs b/src/shims/foreign_items.rs index cd6024444fa..24fa119446e 100644 --- a/src/shims/foreign_items.rs +++ b/src/shims/foreign_items.rs @@ -486,7 +486,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx } // Platform-specific shims - _ => match this.tcx.sess.target.target_os.as_str() { + _ => match this.tcx.sess.target.os.as_str() { "linux" | "macos" => return shims::posix::foreign_items::EvalContextExt::emulate_foreign_item_by_name(this, link_name, args, dest, ret), "windows" => return shims::windows::foreign_items::EvalContextExt::emulate_foreign_item_by_name(this, link_name, args, dest, ret), target => throw_unsup_format!("the target `{}` is not supported", target), diff --git a/src/shims/os_str.rs b/src/shims/os_str.rs index 268b0902e9c..21b5a876463 100644 --- a/src/shims/os_str.rs +++ b/src/shims/os_str.rs @@ -234,7 +234,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx direction: PathConversion, ) -> Cow<'a, OsStr> { let this = self.eval_context_ref(); - let target_os = &this.tcx.sess.target.target_os; + let target_os = &this.tcx.sess.target.os; #[cfg(windows)] return if target_os == "windows" { // Windows-on-Windows, all fine. diff --git a/src/shims/posix/foreign_items.rs b/src/shims/posix/foreign_items.rs index c527fa0d064..aac164b709b 100644 --- a/src/shims/posix/foreign_items.rs +++ b/src/shims/posix/foreign_items.rs @@ -165,7 +165,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx this.read_scalar(handle)?.to_machine_usize(this)?; let symbol = this.read_scalar(symbol)?.check_init()?; let symbol_name = this.memory.read_c_str(symbol)?; - if let Some(dlsym) = Dlsym::from_str(symbol_name, &this.tcx.sess.target.target_os)? { + if let Some(dlsym) = Dlsym::from_str(symbol_name, &this.tcx.sess.target.os)? { let ptr = this.memory.create_fn_alloc(FnVal::Other(dlsym)); this.write_scalar(Scalar::from(ptr), dest)?; } else { @@ -452,7 +452,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx // Platform-specific shims _ => { - match this.tcx.sess.target.target_os.as_str() { + match this.tcx.sess.target.os.as_str() { "linux" => return shims::posix::linux::foreign_items::EvalContextExt::emulate_foreign_item_by_name(this, link_name, args, dest, ret), "macos" => return shims::posix::macos::foreign_items::EvalContextExt::emulate_foreign_item_by_name(this, link_name, args, dest, ret), _ => unreachable!(), diff --git a/src/shims/posix/fs.rs b/src/shims/posix/fs.rs index a9d102912ab..50589ca322d 100644 --- a/src/shims/posix/fs.rs +++ b/src/shims/posix/fs.rs @@ -555,7 +555,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx }, None => return this.handle_not_found(), } - } else if this.tcx.sess.target.target_os == "macos" + } else if this.tcx.sess.target.os == "macos" && cmd == this.eval_libc_i32("F_FULLFSYNC")? { let &[_, _] = check_arg_count(args)?; @@ -989,7 +989,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx this.check_no_isolation("`mkdir`")?; #[cfg_attr(not(unix), allow(unused_variables))] - let mode = if this.tcx.sess.target.target_os == "macos" { + let mode = if this.tcx.sess.target.os == "macos" { u32::from(this.read_scalar(mode_op)?.check_init()?.to_u16()?) } else { this.read_scalar(mode_op)?.to_u32()? diff --git a/src/shims/posix/linux/dlsym.rs b/src/shims/posix/linux/dlsym.rs index af5f5a20e44..ca5cf3ffe8f 100644 --- a/src/shims/posix/linux/dlsym.rs +++ b/src/shims/posix/linux/dlsym.rs @@ -27,7 +27,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx ) -> InterpResult<'tcx> { let this = self.eval_context_mut(); let (_dest, _ret) = ret.expect("we don't support any diverging dlsym"); - assert!(this.tcx.sess.target.target_os == "linux"); + assert!(this.tcx.sess.target.os == "linux"); match dlsym {} } diff --git a/src/shims/posix/macos/dlsym.rs b/src/shims/posix/macos/dlsym.rs index 82d8b16ad66..5b59cf27ee3 100644 --- a/src/shims/posix/macos/dlsym.rs +++ b/src/shims/posix/macos/dlsym.rs @@ -32,7 +32,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx ) -> InterpResult<'tcx> { let this = self.eval_context_mut(); let (dest, ret) = ret.expect("we don't support any diverging dlsym"); - assert!(this.tcx.sess.target.target_os == "macos"); + assert!(this.tcx.sess.target.os == "macos"); match dlsym { Dlsym::getentropy => { diff --git a/src/shims/tls.rs b/src/shims/tls.rs index 7b4d8fa56ae..2ca860367ef 100644 --- a/src/shims/tls.rs +++ b/src/shims/tls.rs @@ -340,7 +340,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx // This is the first time we got asked to schedule a destructor. The // Windows schedule destructor function must be called exactly once, // this is why it is in this block. - if this.tcx.sess.target.target_os == "windows" { + if this.tcx.sess.target.os == "windows" { // On Windows, we signal that the thread quit by starting the // relevant function, reenabling the thread, and going back to // the scheduler. diff --git a/src/shims/windows/dlsym.rs b/src/shims/windows/dlsym.rs index 5454a00f14d..415299c51fc 100644 --- a/src/shims/windows/dlsym.rs +++ b/src/shims/windows/dlsym.rs @@ -44,7 +44,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx ) -> InterpResult<'tcx> { let this = self.eval_context_mut(); let (dest, ret) = ret.expect("we don't support any diverging dlsym"); - assert!(this.tcx.sess.target.target_os == "windows"); + assert!(this.tcx.sess.target.os == "windows"); match dlsym { Dlsym::AcquireSRWLockExclusive => { diff --git a/src/shims/windows/foreign_items.rs b/src/shims/windows/foreign_items.rs index d141fa57e13..12b714880b3 100644 --- a/src/shims/windows/foreign_items.rs +++ b/src/shims/windows/foreign_items.rs @@ -213,7 +213,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx let &[hModule, lpProcName] = check_arg_count(args)?; this.read_scalar(hModule)?.to_machine_isize(this)?; let name = this.memory.read_c_str(this.read_scalar(lpProcName)?.check_init()?)?; - if let Some(dlsym) = Dlsym::from_str(name, &this.tcx.sess.target.target_os)? { + if let Some(dlsym) = Dlsym::from_str(name, &this.tcx.sess.target.os)? { let ptr = this.memory.create_fn_alloc(FnVal::Other(dlsym)); this.write_scalar(Scalar::from(ptr), dest)?; } else {