Skip to content

Commit c768f3c

Browse files
committed
Auto merge of #2297 - RalfJung:rustup, r=RalfJung
rustup
2 parents 5815d8d + 12d04ac commit c768f3c

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bf45371f262e184b4a77adea88c8ac01ac79759b
1+
ca1e68b3229e710c3948a361ee770d846a88e6da

src/concurrency/data_race.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriEvalContextExt<'mir, 'tcx> {
535535
) -> InterpResult<'tcx> {
536536
let this = self.eval_context_mut();
537537
this.validate_overlapping_atomic(dest)?;
538-
this.allow_data_races_mut(move |this| this.write_scalar(val, &(*dest).into()))?;
538+
this.allow_data_races_mut(move |this| this.write_scalar(val, &dest.into()))?;
539539
this.validate_atomic_store(dest, atomic)?;
540540
// FIXME: it's not possible to get the value before write_scalar. A read_scalar will cause
541541
// side effects from a read the program did not perform. So we have to initialise
@@ -562,7 +562,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriEvalContextExt<'mir, 'tcx> {
562562
// Atomics wrap around on overflow.
563563
let val = this.binary_op(op, &old, rhs)?;
564564
let val = if neg { this.unary_op(mir::UnOp::Not, &val)? } else { val };
565-
this.allow_data_races_mut(|this| this.write_immediate(*val, &(*place).into()))?;
565+
this.allow_data_races_mut(|this| this.write_immediate(*val, &place.into()))?;
566566

567567
this.validate_atomic_rmw(place, atomic)?;
568568

@@ -587,7 +587,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriEvalContextExt<'mir, 'tcx> {
587587

588588
this.validate_overlapping_atomic(place)?;
589589
let old = this.allow_data_races_mut(|this| this.read_scalar(&place.into()))?;
590-
this.allow_data_races_mut(|this| this.write_scalar(new, &(*place).into()))?;
590+
this.allow_data_races_mut(|this| this.write_scalar(new, &place.into()))?;
591591

592592
this.validate_atomic_rmw(place, atomic)?;
593593

@@ -616,7 +616,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriEvalContextExt<'mir, 'tcx> {
616616
if lt { &rhs } else { &old }
617617
};
618618

619-
this.allow_data_races_mut(|this| this.write_immediate(**new_val, &(*place).into()))?;
619+
this.allow_data_races_mut(|this| this.write_immediate(**new_val, &place.into()))?;
620620

621621
this.validate_atomic_rmw(place, atomic)?;
622622

@@ -675,7 +675,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriEvalContextExt<'mir, 'tcx> {
675675
// if successful, perform a full rw-atomic validation
676676
// otherwise treat this as an atomic load with the fail ordering.
677677
if cmpxchg_success {
678-
this.allow_data_races_mut(|this| this.write_scalar(new, &(*place).into()))?;
678+
this.allow_data_races_mut(|this| this.write_scalar(new, &place.into()))?;
679679
this.validate_atomic_rmw(place, success)?;
680680
this.buffered_atomic_rmw(new, place, success, old.to_scalar_or_uninit())?;
681681
} else {
@@ -964,7 +964,7 @@ impl VClockAlloc {
964964
let (index, clocks) = global.current_thread_state();
965965
let mut alloc_ranges = self.alloc_ranges.borrow_mut();
966966
for (offset, range) in alloc_ranges.iter_mut(range.start, range.size) {
967-
if let Err(DataRace) = range.read_race_detect(&*clocks, index) {
967+
if let Err(DataRace) = range.read_race_detect(&clocks, index) {
968968
// Report data-race.
969969
return Self::report_data_race(
970970
global,
@@ -992,7 +992,7 @@ impl VClockAlloc {
992992
if global.race_detecting() {
993993
let (index, clocks) = global.current_thread_state();
994994
for (offset, range) in self.alloc_ranges.get_mut().iter_mut(range.start, range.size) {
995-
if let Err(DataRace) = range.write_race_detect(&*clocks, index, write_type) {
995+
if let Err(DataRace) = range.write_race_detect(&clocks, index, write_type) {
996996
// Report data-race
997997
return Self::report_data_race(
998998
global,
@@ -1072,7 +1072,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriEvalContextExt<'mir, 'tcx> {
10721072
for (offset, range) in
10731073
alloc_meta.alloc_ranges.borrow_mut().iter_mut(base_offset, size)
10741074
{
1075-
if let Err(DataRace) = op(range, &mut *clocks, index, atomic) {
1075+
if let Err(DataRace) = op(range, &mut clocks, index, atomic) {
10761076
mem::drop(clocks);
10771077
return VClockAlloc::report_data_race(
10781078
data_race,

src/eval.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
215215
let arg_place =
216216
ecx.allocate(ecx.layout_of(arg_type)?, MiriMemoryKind::Machine.into())?;
217217
ecx.write_os_str_to_c_str(OsStr::new(arg), arg_place.ptr, size)?;
218-
ecx.mark_immutable(&*arg_place);
218+
ecx.mark_immutable(&arg_place);
219219
argvs.push(arg_place.to_ref(&ecx));
220220
}
221221
// Make an array with all these pointers, in the Miri memory.
@@ -227,23 +227,23 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
227227
let place = ecx.mplace_field(&argvs_place, idx)?;
228228
ecx.write_immediate(arg, &place.into())?;
229229
}
230-
ecx.mark_immutable(&*argvs_place);
230+
ecx.mark_immutable(&argvs_place);
231231
// A pointer to that place is the 3rd argument for main.
232232
let argv = argvs_place.to_ref(&ecx);
233233
// Store `argc` and `argv` for macOS `_NSGetArg{c,v}`.
234234
{
235235
let argc_place =
236236
ecx.allocate(ecx.machine.layouts.isize, MiriMemoryKind::Machine.into())?;
237237
ecx.write_scalar(argc, &argc_place.into())?;
238-
ecx.mark_immutable(&*argc_place);
238+
ecx.mark_immutable(&argc_place);
239239
ecx.machine.argc = Some(*argc_place);
240240

241241
let argv_place = ecx.allocate(
242242
ecx.layout_of(tcx.mk_imm_ptr(tcx.types.unit))?,
243243
MiriMemoryKind::Machine.into(),
244244
)?;
245245
ecx.write_immediate(argv, &argv_place.into())?;
246-
ecx.mark_immutable(&*argv_place);
246+
ecx.mark_immutable(&argv_place);
247247
ecx.machine.argv = Some(*argv_place);
248248
}
249249
// Store command line as UTF-16 for Windows `GetCommandLineW`.
@@ -260,7 +260,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
260260
let place = ecx.mplace_field(&cmd_place, idx)?;
261261
ecx.write_scalar(Scalar::from_u16(c), &place.into())?;
262262
}
263-
ecx.mark_immutable(&*cmd_place);
263+
ecx.mark_immutable(&cmd_place);
264264
}
265265
argv
266266
};

src/stacked_borrows.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
928928
orig_tag,
929929
item,
930930
(alloc_id, range, offset),
931-
&mut *global,
931+
&mut global,
932932
current_span,
933933
history,
934934
exposed_tags,
@@ -1090,14 +1090,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
10901090

10911091
#[inline(always)]
10921092
fn ecx(&mut self) -> &mut MiriEvalContext<'mir, 'tcx> {
1093-
&mut self.ecx
1093+
self.ecx
10941094
}
10951095

10961096
fn visit_value(&mut self, place: &MPlaceTy<'tcx, Tag>) -> InterpResult<'tcx> {
10971097
if let Some((mutbl, protector)) = qualify(place.layout.ty, self.kind) {
10981098
let val = self.ecx.read_immediate(&place.into())?;
10991099
let val = self.ecx.retag_reference(&val, mutbl, protector)?;
1100-
self.ecx.write_immediate(*val, &(*place).into())?;
1100+
self.ecx.write_immediate(*val, &place.into())?;
11011101
} else {
11021102
// Maybe we need to go deeper.
11031103
self.walk_value(place)?;

0 commit comments

Comments
 (0)