From 379ac82a1c1d7530070e6676f03c8ca5eb9f7894 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 9 May 2020 10:15:09 +0200 Subject: [PATCH] bump Rust, fix for renames --- rust-version | 2 +- src/diagnostics.rs | 2 +- src/helpers.rs | 2 +- src/shims/sync.rs | 56 +++++++++++++++++++++++----------------------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/rust-version b/rust-version index 050d500e53f..d53d4d68e48 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -a08c47310c7d49cbdc5d7afb38408ba519967ecd +0f9088f9610618e724cfc0cf2ba3721918be5ec9 diff --git a/src/diagnostics.rs b/src/diagnostics.rs index e5e7f0c9047..8296f71773c 100644 --- a/src/diagnostics.rs +++ b/src/diagnostics.rs @@ -118,7 +118,7 @@ pub fn report_error<'tcx, 'mir>( report_msg(ecx, &format!("{}: {}", title, msg), msg, helps, true); // Extra output to help debug specific issues. - if let UndefinedBehavior(UndefinedBehaviorInfo::InvalidUndefBytes(Some(ptr))) = e.kind { + if let UndefinedBehavior(UndefinedBehaviorInfo::InvalidUninitBytes(Some(ptr))) = e.kind { eprintln!( "Uninitialized read occurred at offset 0x{:x} into this allocation:", ptr.offset.bytes(), diff --git a/src/helpers.rs b/src/helpers.rs index 510efe46608..8b20ee2f0d8 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -54,7 +54,7 @@ fn resolve_path(&self, path: &[&str]) -> ty::Instance<'tcx> { fn eval_path_scalar( &mut self, path: &[&str], - ) -> InterpResult<'tcx, ScalarMaybeUndef> { + ) -> InterpResult<'tcx, ScalarMaybeUninit> { let this = self.eval_context_mut(); let instance = this.resolve_path(path); let cid = GlobalId { instance, promoted: None }; diff --git a/src/shims/sync.rs b/src/shims/sync.rs index bc64b1e97a5..c205c5c8ddd 100644 --- a/src/shims/sync.rs +++ b/src/shims/sync.rs @@ -25,7 +25,7 @@ fn get_at_offset<'mir, 'tcx: 'mir>( offset: u64, layout: TyAndLayout<'tcx>, min_size: u64, -) -> InterpResult<'tcx, ScalarMaybeUndef> { +) -> InterpResult<'tcx, ScalarMaybeUninit> { // Ensure that the following read at an offset to the attr pointer is within bounds assert_ptr_target_min_size(ecx, op, min_size)?; let op_place = ecx.deref_operand(op)?; @@ -37,7 +37,7 @@ fn set_at_offset<'mir, 'tcx: 'mir>( ecx: &mut MiriEvalContext<'mir, 'tcx>, op: OpTy<'tcx, Tag>, offset: u64, - value: impl Into>, + value: impl Into>, layout: TyAndLayout<'tcx>, min_size: u64, ) -> InterpResult<'tcx, ()> { @@ -59,14 +59,14 @@ fn set_at_offset<'mir, 'tcx: 'mir>( fn mutexattr_get_kind<'mir, 'tcx: 'mir>( ecx: &MiriEvalContext<'mir, 'tcx>, attr_op: OpTy<'tcx, Tag>, -) -> InterpResult<'tcx, ScalarMaybeUndef> { +) -> InterpResult<'tcx, ScalarMaybeUninit> { get_at_offset(ecx, attr_op, 0, ecx.machine.layouts.i32, PTHREAD_MUTEXATTR_T_MIN_SIZE) } fn mutexattr_set_kind<'mir, 'tcx: 'mir>( ecx: &mut MiriEvalContext<'mir, 'tcx>, attr_op: OpTy<'tcx, Tag>, - kind: impl Into>, + kind: impl Into>, ) -> InterpResult<'tcx, ()> { set_at_offset(ecx, attr_op, 0, kind, ecx.machine.layouts.i32, PTHREAD_MUTEXATTR_T_MIN_SIZE) } @@ -88,14 +88,14 @@ fn mutexattr_set_kind<'mir, 'tcx: 'mir>( fn mutex_get_locked_count<'mir, 'tcx: 'mir>( ecx: &MiriEvalContext<'mir, 'tcx>, mutex_op: OpTy<'tcx, Tag>, -) -> InterpResult<'tcx, ScalarMaybeUndef> { +) -> InterpResult<'tcx, ScalarMaybeUninit> { get_at_offset(ecx, mutex_op, 4, ecx.machine.layouts.u32, PTHREAD_MUTEX_T_MIN_SIZE) } fn mutex_set_locked_count<'mir, 'tcx: 'mir>( ecx: &mut MiriEvalContext<'mir, 'tcx>, mutex_op: OpTy<'tcx, Tag>, - locked_count: impl Into>, + locked_count: impl Into>, ) -> InterpResult<'tcx, ()> { set_at_offset(ecx, mutex_op, 4, locked_count, ecx.machine.layouts.u32, PTHREAD_MUTEX_T_MIN_SIZE) } @@ -103,14 +103,14 @@ fn mutex_set_locked_count<'mir, 'tcx: 'mir>( fn mutex_get_owner<'mir, 'tcx: 'mir>( ecx: &MiriEvalContext<'mir, 'tcx>, mutex_op: OpTy<'tcx, Tag>, -) -> InterpResult<'tcx, ScalarMaybeUndef> { +) -> InterpResult<'tcx, ScalarMaybeUninit> { get_at_offset(ecx, mutex_op, 8, ecx.machine.layouts.u32, PTHREAD_MUTEX_T_MIN_SIZE) } fn mutex_set_owner<'mir, 'tcx: 'mir>( ecx: &mut MiriEvalContext<'mir, 'tcx>, mutex_op: OpTy<'tcx, Tag>, - owner: impl Into>, + owner: impl Into>, ) -> InterpResult<'tcx, ()> { set_at_offset(ecx, mutex_op, 8, owner, ecx.machine.layouts.u32, PTHREAD_MUTEX_T_MIN_SIZE) } @@ -118,7 +118,7 @@ fn mutex_set_owner<'mir, 'tcx: 'mir>( fn mutex_get_kind<'mir, 'tcx: 'mir>( ecx: &mut MiriEvalContext<'mir, 'tcx>, mutex_op: OpTy<'tcx, Tag>, -) -> InterpResult<'tcx, ScalarMaybeUndef> { +) -> InterpResult<'tcx, ScalarMaybeUninit> { let offset = if ecx.pointer_size().bytes() == 8 { 16 } else { 12 }; get_at_offset(ecx, mutex_op, offset, ecx.machine.layouts.i32, PTHREAD_MUTEX_T_MIN_SIZE) } @@ -126,7 +126,7 @@ fn mutex_get_kind<'mir, 'tcx: 'mir>( fn mutex_set_kind<'mir, 'tcx: 'mir>( ecx: &mut MiriEvalContext<'mir, 'tcx>, mutex_op: OpTy<'tcx, Tag>, - kind: impl Into>, + kind: impl Into>, ) -> InterpResult<'tcx, ()> { let offset = if ecx.pointer_size().bytes() == 8 { 16 } else { 12 }; set_at_offset(ecx, mutex_op, offset, kind, ecx.machine.layouts.i32, PTHREAD_MUTEX_T_MIN_SIZE) @@ -135,14 +135,14 @@ fn mutex_set_kind<'mir, 'tcx: 'mir>( fn mutex_get_blockset<'mir, 'tcx: 'mir>( ecx: &MiriEvalContext<'mir, 'tcx>, mutex_op: OpTy<'tcx, Tag>, -) -> InterpResult<'tcx, ScalarMaybeUndef> { +) -> InterpResult<'tcx, ScalarMaybeUninit> { get_at_offset(ecx, mutex_op, 20, ecx.machine.layouts.u32, PTHREAD_MUTEX_T_MIN_SIZE) } fn mutex_set_blockset<'mir, 'tcx: 'mir>( ecx: &mut MiriEvalContext<'mir, 'tcx>, mutex_op: OpTy<'tcx, Tag>, - blockset: impl Into>, + blockset: impl Into>, ) -> InterpResult<'tcx, ()> { set_at_offset(ecx, mutex_op, 20, blockset, ecx.machine.layouts.u32, PTHREAD_MUTEX_T_MIN_SIZE) } @@ -180,14 +180,14 @@ fn mutex_get_or_create_blockset<'mir, 'tcx: 'mir>( fn rwlock_get_readers<'mir, 'tcx: 'mir>( ecx: &MiriEvalContext<'mir, 'tcx>, rwlock_op: OpTy<'tcx, Tag>, -) -> InterpResult<'tcx, ScalarMaybeUndef> { +) -> InterpResult<'tcx, ScalarMaybeUninit> { get_at_offset(ecx, rwlock_op, 4, ecx.machine.layouts.u32, PTHREAD_RWLOCK_T_MIN_SIZE) } fn rwlock_set_readers<'mir, 'tcx: 'mir>( ecx: &mut MiriEvalContext<'mir, 'tcx>, rwlock_op: OpTy<'tcx, Tag>, - readers: impl Into>, + readers: impl Into>, ) -> InterpResult<'tcx, ()> { set_at_offset(ecx, rwlock_op, 4, readers, ecx.machine.layouts.u32, PTHREAD_RWLOCK_T_MIN_SIZE) } @@ -195,14 +195,14 @@ fn rwlock_set_readers<'mir, 'tcx: 'mir>( fn rwlock_get_writers<'mir, 'tcx: 'mir>( ecx: &MiriEvalContext<'mir, 'tcx>, rwlock_op: OpTy<'tcx, Tag>, -) -> InterpResult<'tcx, ScalarMaybeUndef> { +) -> InterpResult<'tcx, ScalarMaybeUninit> { get_at_offset(ecx, rwlock_op, 8, ecx.machine.layouts.u32, PTHREAD_RWLOCK_T_MIN_SIZE) } fn rwlock_set_writers<'mir, 'tcx: 'mir>( ecx: &mut MiriEvalContext<'mir, 'tcx>, rwlock_op: OpTy<'tcx, Tag>, - writers: impl Into>, + writers: impl Into>, ) -> InterpResult<'tcx, ()> { set_at_offset(ecx, rwlock_op, 8, writers, ecx.machine.layouts.u32, PTHREAD_RWLOCK_T_MIN_SIZE) } @@ -210,14 +210,14 @@ fn rwlock_set_writers<'mir, 'tcx: 'mir>( fn rwlock_get_writer_blockset<'mir, 'tcx: 'mir>( ecx: &MiriEvalContext<'mir, 'tcx>, rwlock_op: OpTy<'tcx, Tag>, -) -> InterpResult<'tcx, ScalarMaybeUndef> { +) -> InterpResult<'tcx, ScalarMaybeUninit> { get_at_offset(ecx, rwlock_op, 12, ecx.machine.layouts.u32, PTHREAD_RWLOCK_T_MIN_SIZE) } fn rwlock_set_writer_blockset<'mir, 'tcx: 'mir>( ecx: &mut MiriEvalContext<'mir, 'tcx>, rwlock_op: OpTy<'tcx, Tag>, - blockset: impl Into>, + blockset: impl Into>, ) -> InterpResult<'tcx, ()> { set_at_offset(ecx, rwlock_op, 12, blockset, ecx.machine.layouts.u32, PTHREAD_RWLOCK_T_MIN_SIZE) } @@ -241,14 +241,14 @@ fn rwlock_get_or_create_writer_blockset<'mir, 'tcx: 'mir>( fn rwlock_get_reader_blockset<'mir, 'tcx: 'mir>( ecx: &MiriEvalContext<'mir, 'tcx>, rwlock_op: OpTy<'tcx, Tag>, -) -> InterpResult<'tcx, ScalarMaybeUndef> { +) -> InterpResult<'tcx, ScalarMaybeUninit> { get_at_offset(ecx, rwlock_op, 16, ecx.machine.layouts.u32, PTHREAD_RWLOCK_T_MIN_SIZE) } fn rwlock_set_reader_blockset<'mir, 'tcx: 'mir>( ecx: &mut MiriEvalContext<'mir, 'tcx>, rwlock_op: OpTy<'tcx, Tag>, - blockset: impl Into>, + blockset: impl Into>, ) -> InterpResult<'tcx, ()> { set_at_offset(ecx, rwlock_op, 16, blockset, ecx.machine.layouts.u32, PTHREAD_RWLOCK_T_MIN_SIZE) } @@ -304,7 +304,7 @@ fn pthread_mutexattr_settype( fn pthread_mutexattr_destroy(&mut self, attr_op: OpTy<'tcx, Tag>) -> InterpResult<'tcx, i32> { let this = self.eval_context_mut(); - mutexattr_set_kind(this, attr_op, ScalarMaybeUndef::Undef)?; + mutexattr_set_kind(this, attr_op, ScalarMaybeUninit::Uninit)?; Ok(0) } @@ -458,9 +458,9 @@ fn pthread_mutex_destroy(&mut self, mutex_op: OpTy<'tcx, Tag>) -> InterpResult<' throw_ub_format!("destroyed a locked mutex"); } - mutex_set_kind(this, mutex_op, ScalarMaybeUndef::Undef)?; - mutex_set_locked_count(this, mutex_op, ScalarMaybeUndef::Undef)?; - mutex_set_blockset(this, mutex_op, ScalarMaybeUndef::Undef)?; + mutex_set_kind(this, mutex_op, ScalarMaybeUninit::Uninit)?; + mutex_set_locked_count(this, mutex_op, ScalarMaybeUninit::Uninit)?; + mutex_set_blockset(this, mutex_op, ScalarMaybeUninit::Uninit)?; Ok(0) } @@ -579,10 +579,10 @@ fn pthread_rwlock_destroy(&mut self, rwlock_op: OpTy<'tcx, Tag>) -> InterpResult throw_ub_format!("destroyed a locked rwlock"); } - rwlock_set_readers(this, rwlock_op, ScalarMaybeUndef::Undef)?; - rwlock_set_writers(this, rwlock_op, ScalarMaybeUndef::Undef)?; - rwlock_set_reader_blockset(this, rwlock_op, ScalarMaybeUndef::Undef)?; - rwlock_set_writer_blockset(this, rwlock_op, ScalarMaybeUndef::Undef)?; + rwlock_set_readers(this, rwlock_op, ScalarMaybeUninit::Uninit)?; + rwlock_set_writers(this, rwlock_op, ScalarMaybeUninit::Uninit)?; + rwlock_set_reader_blockset(this, rwlock_op, ScalarMaybeUninit::Uninit)?; + rwlock_set_writer_blockset(this, rwlock_op, ScalarMaybeUninit::Uninit)?; Ok(0) } -- 2.44.0