Skip to content

Commit f2bbc1b

Browse files
committed
clippy
1 parent f1b6b85 commit f2bbc1b

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

src/tools/miri/src/borrow_tracker/tree_borrows/tree/tests.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ fn all_read_accesses_commute() {
6161
// ... and produce the same final result.
6262
assert_eq!(
6363
loc12, loc21,
64-
"Read accesses {:?} followed by {:?} do not commute !",
65-
rel1, rel2
64+
"Read accesses {rel1:?} followed by {rel2:?} do not commute !"
6665
);
6766
}
6867
}
@@ -674,8 +673,8 @@ mod spurious_read {
674673
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
675674
let (x, y) = self.retag_permissions();
676675
write!(f, "{}; ", self.xy_rel)?;
677-
write!(f, "y: ({}); ", y,)?;
678-
write!(f, "retag x ({}); ", x)?;
676+
write!(f, "y: ({y}); ")?;
677+
write!(f, "retag x ({x}); ")?;
679678

680679
write!(f, "<arbitrary code>; <spurious read x>;")?;
681680
Ok(())
@@ -730,17 +729,17 @@ mod spurious_read {
730729
// protector.
731730
final_source
732731
.distinguishable::</*X*/ AllowRet, /*Y*/ AllowRet>(&final_target)
733-
.then_some(format!("{}", final_target))
732+
.then_some(format!("{final_target}"))
734733
} else {
735734
Some(format!("UB"))
736735
}
737736
};
738737
if let Some(final_target) = distinguishable {
739738
eprintln!(
740-
"For pattern '{}', inserting a spurious read through x makes the final state '{}' instead of '{}' which is observable",
741-
pat, final_target, final_source
739+
"For pattern '{pat}', inserting a spurious read through x makes the final state '{final_target}' \
740+
instead of '{final_source}' which is observable"
742741
);
743-
eprintln!(" (arbitrary code instanciated with '{}')", opaque);
742+
eprintln!(" (arbitrary code instanciated with '{opaque}')");
744743
err += 1;
745744
// We found an instanciation of the opaque code that makes this Pattern
746745
// fail, we don't really need to check the rest.

src/tools/miri/src/concurrency/data_race.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ impl AccessType {
381381
});
382382

383383
if let Some(ty) = ty {
384-
msg.push_str(&format!(" of type `{}`", ty));
384+
msg.push_str(&format!(" of type `{ty}`"));
385385
}
386386

387387
msg

src/tools/miri/src/machine.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -721,9 +721,8 @@ impl<'tcx> MiriMachine<'tcx> {
721721
// Check if host target == the session target.
722722
if host_triple != target_triple {
723723
panic!(
724-
"calling external C functions in linked .so file requires host and target to be the same: host={}, target={}",
725-
host_triple,
726-
target_triple,
724+
"calling native C functions in linked .so file requires host and target to be the same: \
725+
host={host_triple}, target={target_triple}",
727726
);
728727
}
729728
// Note: it is the user's responsibility to provide a correct SO file.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
191191
tm_zone.push('+');
192192
}
193193
let offset_hour = offset_in_seconds.abs() / 3600;
194-
write!(tm_zone, "{:02}", offset_hour).unwrap();
194+
write!(tm_zone, "{offset_hour:02}").unwrap();
195195
let offset_min = (offset_in_seconds.abs() % 3600) / 60;
196196
if offset_min != 0 {
197-
write!(tm_zone, "{:02}", offset_min).unwrap();
197+
write!(tm_zone, "{offset_min:02}").unwrap();
198198
}
199199

200200
// Add null terminator for C string compatibility.

0 commit comments

Comments
 (0)