Skip to content

Commit 8f05e4c

Browse files
author
The Miri Cronjob Bot
committed
fmt
1 parent 97633d8 commit 8f05e4c

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

Diff for: src/tools/miri/src/machine.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,10 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
12451245
/// Called on `ptr as usize` casts.
12461246
/// (Actually computing the resulting `usize` doesn't need machine help,
12471247
/// that's just `Scalar::try_to_int`.)
1248-
fn expose_provenance(ecx: &InterpCx<'tcx, Self>, provenance: Self::Provenance) -> InterpResult<'tcx> {
1248+
fn expose_provenance(
1249+
ecx: &InterpCx<'tcx, Self>,
1250+
provenance: Self::Provenance,
1251+
) -> InterpResult<'tcx> {
12491252
match provenance {
12501253
Provenance::Concrete { alloc_id, tag } => ecx.expose_ptr(alloc_id, tag),
12511254
Provenance::Wildcard => {

Diff for: src/tools/miri/src/shims/native_lib.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ use std::ops::Deref;
44
use libffi::high::call as ffi;
55
use libffi::low::CodePtr;
66
use rustc_abi::{BackendRepr, HasDataLayout, Size};
7-
use rustc_middle::{
8-
mir::interpret::Pointer,
9-
ty::{self as ty, IntTy, UintTy},
10-
};
7+
use rustc_middle::mir::interpret::Pointer;
8+
use rustc_middle::ty::{self as ty, IntTy, UintTy};
119
use rustc_span::Symbol;
1210

1311
use crate::*;
@@ -177,7 +175,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
177175
this.prepare_for_native_call(alloc_id, prov)?;
178176
}
179177
}
180-
178+
181179
// FIXME: In the future, we should also call `prepare_for_native_call` on all previously
182180
// exposed allocations, since C may access any of them.
183181

Diff for: src/tools/miri/tests/native-lib/pass/ptr_write_access.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//@only-on-host
44
//@compile-flags: -Zmiri-permissive-provenance
55

6-
76
#![feature(box_as_ptr)]
87

98
use std::mem::MaybeUninit;
@@ -60,7 +59,7 @@ fn test_init_array() {
6059
const LEN: usize = 3;
6160
let mut array = MaybeUninit::<[i32; LEN]>::uninit();
6261
let val = 31;
63-
62+
6463
let array = unsafe {
6564
init_array(array.as_mut_ptr().cast::<i32>(), LEN, val);
6665
array.assume_init()
@@ -72,7 +71,7 @@ fn test_init_array() {
7271
fn test_init_static_inner() {
7372
#[repr(C)]
7473
struct SyncPtr {
75-
ptr: *mut i32
74+
ptr: *mut i32,
7675
}
7776
unsafe impl Sync for SyncPtr {}
7877

@@ -183,17 +182,12 @@ fn test_swap_ptr_triple_dangling() {
183182
let ptr = Box::as_ptr(&b);
184183
drop(b);
185184
let z = 121;
186-
let triple = Triple {
187-
ptr0: &raw const x,
188-
ptr1: ptr,
189-
ptr2: &raw const z
190-
};
185+
let triple = Triple { ptr0: &raw const x, ptr1: ptr, ptr2: &raw const z };
191186

192187
unsafe { swap_ptr_triple_dangling(&triple) }
193188
assert_eq!(unsafe { *triple.ptr2 }, x);
194189
}
195190

196-
197191
/// Test function that directly returns its pointer argument.
198192
fn test_return_ptr() {
199193
extern "C" {

0 commit comments

Comments
 (0)