about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorThe Miri Cronjob Bot <miri@cron.bot>2024-12-07 05:05:09 +0000
committerThe Miri Cronjob Bot <miri@cron.bot>2024-12-07 05:05:09 +0000
commit8f05e4c4cedd1f7db7d4615fcdfc56c16be2a07e (patch)
tree94ca6a62c8b2c4f759dff51c1ec04bdfba8c1bad /src
parent97633d8e607f10c7558e07351bc32d7893f3e675 (diff)
downloadrust-8f05e4c4cedd1f7db7d4615fcdfc56c16be2a07e.tar.gz
rust-8f05e4c4cedd1f7db7d4615fcdfc56c16be2a07e.zip
fmt
Diffstat (limited to 'src')
-rw-r--r--src/tools/miri/src/machine.rs5
-rw-r--r--src/tools/miri/src/shims/native_lib.rs8
-rw-r--r--src/tools/miri/tests/native-lib/pass/ptr_write_access.rs12
3 files changed, 10 insertions, 15 deletions
diff --git a/src/tools/miri/src/machine.rs b/src/tools/miri/src/machine.rs
index 888465c5262..7cc22f83a24 100644
--- a/src/tools/miri/src/machine.rs
+++ b/src/tools/miri/src/machine.rs
@@ -1245,7 +1245,10 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
     /// Called on `ptr as usize` casts.
     /// (Actually computing the resulting `usize` doesn't need machine help,
     /// that's just `Scalar::try_to_int`.)
-    fn expose_provenance(ecx: &InterpCx<'tcx, Self>, provenance: Self::Provenance) -> InterpResult<'tcx> {
+    fn expose_provenance(
+        ecx: &InterpCx<'tcx, Self>,
+        provenance: Self::Provenance,
+    ) -> InterpResult<'tcx> {
         match provenance {
             Provenance::Concrete { alloc_id, tag } => ecx.expose_ptr(alloc_id, tag),
             Provenance::Wildcard => {
diff --git a/src/tools/miri/src/shims/native_lib.rs b/src/tools/miri/src/shims/native_lib.rs
index 4082b8eed45..f18d0236774 100644
--- a/src/tools/miri/src/shims/native_lib.rs
+++ b/src/tools/miri/src/shims/native_lib.rs
@@ -4,10 +4,8 @@ use std::ops::Deref;
 use libffi::high::call as ffi;
 use libffi::low::CodePtr;
 use rustc_abi::{BackendRepr, HasDataLayout, Size};
-use rustc_middle::{
-    mir::interpret::Pointer,
-    ty::{self as ty, IntTy, UintTy},
-};
+use rustc_middle::mir::interpret::Pointer;
+use rustc_middle::ty::{self as ty, IntTy, UintTy};
 use rustc_span::Symbol;
 
 use crate::*;
@@ -177,7 +175,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
                 this.prepare_for_native_call(alloc_id, prov)?;
             }
         }
-        
+
         // FIXME: In the future, we should also call `prepare_for_native_call` on all previously
         // exposed allocations, since C may access any of them.
 
diff --git a/src/tools/miri/tests/native-lib/pass/ptr_write_access.rs b/src/tools/miri/tests/native-lib/pass/ptr_write_access.rs
index 4045ef3cee5..a92e63a4da6 100644
--- a/src/tools/miri/tests/native-lib/pass/ptr_write_access.rs
+++ b/src/tools/miri/tests/native-lib/pass/ptr_write_access.rs
@@ -3,7 +3,6 @@
 //@only-on-host
 //@compile-flags: -Zmiri-permissive-provenance
 
-
 #![feature(box_as_ptr)]
 
 use std::mem::MaybeUninit;
@@ -60,7 +59,7 @@ fn test_init_array() {
     const LEN: usize = 3;
     let mut array = MaybeUninit::<[i32; LEN]>::uninit();
     let val = 31;
-    
+
     let array = unsafe {
         init_array(array.as_mut_ptr().cast::<i32>(), LEN, val);
         array.assume_init()
@@ -72,7 +71,7 @@ fn test_init_array() {
 fn test_init_static_inner() {
     #[repr(C)]
     struct SyncPtr {
-        ptr: *mut i32
+        ptr: *mut i32,
     }
     unsafe impl Sync for SyncPtr {}
 
@@ -183,17 +182,12 @@ fn test_swap_ptr_triple_dangling() {
     let ptr = Box::as_ptr(&b);
     drop(b);
     let z = 121;
-    let triple = Triple {
-        ptr0: &raw const x,
-        ptr1: ptr,
-        ptr2: &raw const z
-    };
+    let triple = Triple { ptr0: &raw const x, ptr1: ptr, ptr2: &raw const z };
 
     unsafe { swap_ptr_triple_dangling(&triple) }
     assert_eq!(unsafe { *triple.ptr2 }, x);
 }
 
-
 /// Test function that directly returns its pointer argument.
 fn test_return_ptr() {
     extern "C" {