Skip to content

Commit bb7c9e7

Browse files
committed
fmt and clippy
1 parent 2be695b commit bb7c9e7

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed

src/borrow_tracker/mod.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,15 +264,23 @@ impl GlobalStateInner {
264264

265265
impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriInterpCx<'mir, 'tcx> {}
266266
pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
267-
fn retag_ptr_value(&mut self, kind: RetagKind, val: &ImmTy<'tcx, Provenance>) -> InterpResult<'tcx, ImmTy<'tcx, Provenance>> {
267+
fn retag_ptr_value(
268+
&mut self,
269+
kind: RetagKind,
270+
val: &ImmTy<'tcx, Provenance>,
271+
) -> InterpResult<'tcx, ImmTy<'tcx, Provenance>> {
268272
let this = self.eval_context_mut();
269273
let method = this.machine.borrow_tracker.as_ref().unwrap().borrow().borrow_tracker_method;
270274
match method {
271275
BorrowTrackerMethod::StackedBorrows => this.sb_retag_ptr_value(kind, val),
272276
}
273277
}
274278

275-
fn retag_place_contents(&mut self, kind: RetagKind, place: &PlaceTy<'tcx, Provenance>) -> InterpResult<'tcx> {
279+
fn retag_place_contents(
280+
&mut self,
281+
kind: RetagKind,
282+
place: &PlaceTy<'tcx, Provenance>,
283+
) -> InterpResult<'tcx> {
276284
let this = self.eval_context_mut();
277285
let method = this.machine.borrow_tracker.as_ref().unwrap().borrow().borrow_tracker_method;
278286
match method {

src/borrow_tracker/stacked_borrows/diagnostics.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,9 @@ impl<'history, 'ecx, 'mir, 'tcx> DiagnosticCx<'history, 'ecx, 'mir, 'tcx> {
462462
Operation::Retag(RetagOp { orig_tag, permission, new_tag, .. }) => {
463463
let permission = permission
464464
.expect("start_grant should set the current permission before popping a tag");
465-
format!(" due to {permission:?} retag from {orig_tag:?} (that retag created {new_tag:?})")
465+
format!(
466+
" due to {permission:?} retag from {orig_tag:?} (that retag created {new_tag:?})"
467+
)
466468
}
467469
};
468470

src/borrow_tracker/stacked_borrows/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use rustc_middle::mir::{Mutability, RetagKind};
1414
use rustc_middle::ty::{
1515
self,
1616
layout::{HasParamEnv, LayoutOf},
17+
Ty,
1718
};
1819
use rustc_target::abi::{Abi, Size};
1920

@@ -64,7 +65,7 @@ impl NewPermission {
6465
/// A key function: determine the permissions to grant at a retag for the given kind of
6566
/// reference/pointer.
6667
fn from_ref_ty<'tcx>(
67-
ty: ty::Ty<'tcx>,
68+
ty: Ty<'tcx>,
6869
kind: RetagKind,
6970
cx: &crate::MiriInterpCx<'_, 'tcx>,
7071
) -> Self {
@@ -864,7 +865,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
864865
RetagKind::FnEntry => unreachable!(),
865866
RetagKind::Raw | RetagKind::Default => RetagCause::Normal,
866867
};
867-
this.sb_retag_reference(&val, new_perm, retag_cause)
868+
this.sb_retag_reference(val, new_perm, retag_cause)
868869
}
869870

870871
fn sb_retag_place_contents(

src/diagnostics.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,8 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
393393

394394
let msg = match &e {
395395
CreatedPointerTag(tag, None, _) => format!("created base tag {tag:?}"),
396-
CreatedPointerTag(tag, Some(perm), None) => format!("created {tag:?} with {perm} derived from unknown tag"),
396+
CreatedPointerTag(tag, Some(perm), None) =>
397+
format!("created {tag:?} with {perm} derived from unknown tag"),
397398
CreatedPointerTag(tag, Some(perm), Some((alloc_id, range, orig_tag))) =>
398399
format!(
399400
"created tag {tag:?} with {perm} at {alloc_id:?}{range:?} derived from {orig_tag:?}"

src/machine.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -967,9 +967,8 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
967967
ptr: Pointer<Self::Provenance>,
968968
) -> InterpResult<'tcx> {
969969
match ptr.provenance {
970-
Provenance::Concrete { alloc_id, tag } => {
971-
intptrcast::GlobalStateInner::expose_ptr(ecx, alloc_id, tag)
972-
}
970+
Provenance::Concrete { alloc_id, tag } =>
971+
intptrcast::GlobalStateInner::expose_ptr(ecx, alloc_id, tag),
973972
Provenance::Wildcard => {
974973
// No need to do anything for wildcard pointers as
975974
// their provenances have already been previously exposed.

0 commit comments

Comments
 (0)