Skip to content

Commit 29814f2

Browse files
committed
clippy
1 parent b64d867 commit 29814f2

File tree

5 files changed

+15
-42
lines changed

5 files changed

+15
-42
lines changed

src/tools/miri/cargo-miri/src/phases.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,7 @@ pub fn phase_runner(mut binary_args: impl Iterator<Item = String>, phase: Runner
486486
continue;
487487
} else if verbose > 0 {
488488
eprintln!(
489-
"[cargo-miri runner] Overwriting run-time env var {:?}={:?} with build-time value {:?}",
490-
name, old_val, val
489+
"[cargo-miri runner] Overwriting run-time env var {name:?}={old_val:?} with build-time value {val:?}"
491490
);
492491
}
493492
}

src/tools/miri/src/bin/miri.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,7 @@ fn init_late_loggers(tcx: TyCtxt<'_>) {
192192
if log::Level::from_str(&var).is_ok() {
193193
env::set_var(
194194
"RUSTC_LOG",
195-
format!(
196-
"rustc_middle::mir::interpret={0},rustc_const_eval::interpret={0}",
197-
var
198-
),
195+
format!("rustc_middle::mir::interpret={var},rustc_const_eval::interpret={var}"),
199196
);
200197
} else {
201198
env::set_var("RUSTC_LOG", &var);

src/tools/miri/src/concurrency/vector_clock.rs

+9-27
Original file line numberDiff line numberDiff line change
@@ -404,67 +404,49 @@ mod tests {
404404
assert_eq!(
405405
alt_compare,
406406
o.map(Ordering::reverse),
407-
"Invalid alt comparison\n l: {:?}\n r: {:?}",
408-
l,
409-
r
407+
"Invalid alt comparison\n l: {l:?}\n r: {r:?}"
410408
);
411409

412410
//Test operators with faster implementations
413411
assert_eq!(
414412
matches!(compare, Some(Ordering::Less)),
415413
l < r,
416-
"Invalid (<):\n l: {:?}\n r: {:?}",
417-
l,
418-
r
414+
"Invalid (<):\n l: {l:?}\n r: {r:?}"
419415
);
420416
assert_eq!(
421417
matches!(compare, Some(Ordering::Less) | Some(Ordering::Equal)),
422418
l <= r,
423-
"Invalid (<=):\n l: {:?}\n r: {:?}",
424-
l,
425-
r
419+
"Invalid (<=):\n l: {l:?}\n r: {r:?}"
426420
);
427421
assert_eq!(
428422
matches!(compare, Some(Ordering::Greater)),
429423
l > r,
430-
"Invalid (>):\n l: {:?}\n r: {:?}",
431-
l,
432-
r
424+
"Invalid (>):\n l: {l:?}\n r: {r:?}"
433425
);
434426
assert_eq!(
435427
matches!(compare, Some(Ordering::Greater) | Some(Ordering::Equal)),
436428
l >= r,
437-
"Invalid (>=):\n l: {:?}\n r: {:?}",
438-
l,
439-
r
429+
"Invalid (>=):\n l: {l:?}\n r: {r:?}"
440430
);
441431
assert_eq!(
442432
matches!(alt_compare, Some(Ordering::Less)),
443433
r < l,
444-
"Invalid alt (<):\n l: {:?}\n r: {:?}",
445-
l,
446-
r
434+
"Invalid alt (<):\n l: {l:?}\n r: {r:?}"
447435
);
448436
assert_eq!(
449437
matches!(alt_compare, Some(Ordering::Less) | Some(Ordering::Equal)),
450438
r <= l,
451-
"Invalid alt (<=):\n l: {:?}\n r: {:?}",
452-
l,
453-
r
439+
"Invalid alt (<=):\n l: {l:?}\n r: {r:?}"
454440
);
455441
assert_eq!(
456442
matches!(alt_compare, Some(Ordering::Greater)),
457443
r > l,
458-
"Invalid alt (>):\n l: {:?}\n r: {:?}",
459-
l,
460-
r
444+
"Invalid alt (>):\n l: {l:?}\n r: {r:?}"
461445
);
462446
assert_eq!(
463447
matches!(alt_compare, Some(Ordering::Greater) | Some(Ordering::Equal)),
464448
r >= l,
465-
"Invalid alt (>=):\n l: {:?}\n r: {:?}",
466-
l,
467-
r
449+
"Invalid alt (>=):\n l: {l:?}\n r: {r:?}"
468450
);
469451
}
470452
}

src/tools/miri/src/helpers.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -554,9 +554,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
554554
assert_eq!(
555555
self.eval_context_ref().tcx.sess.target.os,
556556
target_os,
557-
"`{}` is only available on the `{}` target OS",
558-
name,
559-
target_os,
557+
"`{name}` is only available on the `{target_os}` target OS",
560558
)
561559
}
562560

@@ -566,8 +564,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
566564
fn assert_target_os_is_unix(&self, name: &str) {
567565
assert!(
568566
target_os_is_unix(self.eval_context_ref().tcx.sess.target.os.as_ref()),
569-
"`{}` is only available for supported UNIX family targets",
570-
name,
567+
"`{name}` is only available for supported UNIX family targets",
571568
);
572569
}
573570

@@ -1019,8 +1016,7 @@ where
10191016

10201017
pub fn isolation_abort_error<'tcx>(name: &str) -> InterpResult<'tcx> {
10211018
throw_machine_stop!(TerminationInfo::UnsupportedInIsolation(format!(
1022-
"{} not available when isolation is enabled",
1023-
name,
1019+
"{name} not available when isolation is enabled",
10241020
)))
10251021
}
10261022

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
299299
return Ok(Some(body));
300300
}
301301
this.handle_unsupported(format!(
302-
"can't call (diverging) foreign function: {}",
303-
link_name
302+
"can't call (diverging) foreign function: {link_name}"
304303
))?;
305304
return Ok(None);
306305
}

0 commit comments

Comments
 (0)