Skip to content

Commit bf296bb

Browse files
committed
fmt
1 parent e5bede1 commit bf296bb

File tree

4 files changed

+11
-20
lines changed

4 files changed

+11
-20
lines changed

src/tools/miri/src/shims/backtrace.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
194194
let filename_alloc =
195195
this.allocate_str(&filename, MiriMemoryKind::Rust.into(), Mutability::Mut)?;
196196

197-
this.write_immediate(
198-
name_alloc.to_ref(this),
199-
&this.project_field(&dest, 0)?,
200-
)?;
201-
this.write_immediate(
202-
filename_alloc.to_ref(this),
203-
&this.project_field(&dest, 1)?,
204-
)?;
197+
this.write_immediate(name_alloc.to_ref(this), &this.project_field(&dest, 0)?)?;
198+
this.write_immediate(filename_alloc.to_ref(this), &this.project_field(&dest, 1)?)?;
205199
}
206200
1 => {
207201
this.write_scalar(

src/tools/miri/src/shims/time.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
156156
let qpc = i64::try_from(duration.as_nanos()).map_err(|_| {
157157
err_unsup_format!("programs running longer than 2^63 nanoseconds are not supported")
158158
})?;
159-
this.write_scalar(
160-
Scalar::from_i64(qpc),
161-
&this.deref_operand(lpPerformanceCount_op)?,
162-
)?;
159+
this.write_scalar(Scalar::from_i64(qpc), &this.deref_operand(lpPerformanceCount_op)?)?;
163160
Ok(Scalar::from_i32(-1)) // return non-zero on success
164161
}
165162

src/tools/miri/src/shims/unix/macos/foreign_items.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
8686
"_NSGetEnviron" => {
8787
let [] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
8888
this.write_pointer(
89-
this.machine.env_vars.environ.as_ref().expect("machine must be initialized").ptr,
89+
this.machine
90+
.env_vars
91+
.environ
92+
.as_ref()
93+
.expect("machine must be initialized")
94+
.ptr,
9095
dest,
9196
)?;
9297
}
@@ -139,10 +144,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
139144
if written {
140145
this.write_null(dest)?;
141146
} else {
142-
this.write_scalar(
143-
Scalar::from_u32(size_needed.try_into().unwrap()),
144-
&bufsize,
145-
)?;
147+
this.write_scalar(Scalar::from_u32(size_needed.try_into().unwrap()), &bufsize)?;
146148
this.write_int(-1, dest)?;
147149
}
148150
}

src/tools/miri/src/shims/unix/sync.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -867,9 +867,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
867867
cond_get_clock_id(this, cond_op)?;
868868

869869
// This might lead to false positives, see comment in pthread_mutexattr_destroy
870-
this.write_uninit(
871-
&this.deref_operand_as(cond_op, this.libc_ty_layout("pthread_cond_t"))?,
872-
)?;
870+
this.write_uninit(&this.deref_operand_as(cond_op, this.libc_ty_layout("pthread_cond_t"))?)?;
873871
// FIXME: delete interpreter state associated with this condvar.
874872

875873
Ok(0)

0 commit comments

Comments
 (0)