diff options
| -rw-r--r-- | src/tools/miri/cargo-miri/src/phases.rs | 3 | ||||
| -rw-r--r-- | src/tools/miri/src/bin/miri.rs | 5 | ||||
| -rw-r--r-- | src/tools/miri/src/concurrency/vector_clock.rs | 36 | ||||
| -rw-r--r-- | src/tools/miri/src/helpers.rs | 10 | ||||
| -rw-r--r-- | src/tools/miri/src/shims/foreign_items.rs | 3 |
5 files changed, 15 insertions, 42 deletions
diff --git a/src/tools/miri/cargo-miri/src/phases.rs b/src/tools/miri/cargo-miri/src/phases.rs index 91945ad39f5..2bffff47722 100644 --- a/src/tools/miri/cargo-miri/src/phases.rs +++ b/src/tools/miri/cargo-miri/src/phases.rs @@ -486,8 +486,7 @@ pub fn phase_runner(mut binary_args: impl Iterator<Item = String>, phase: Runner continue; } else if verbose > 0 { eprintln!( - "[cargo-miri runner] Overwriting run-time env var {:?}={:?} with build-time value {:?}", - name, old_val, val + "[cargo-miri runner] Overwriting run-time env var {name:?}={old_val:?} with build-time value {val:?}" ); } } diff --git a/src/tools/miri/src/bin/miri.rs b/src/tools/miri/src/bin/miri.rs index 9ac04c4930f..fce95b987f7 100644 --- a/src/tools/miri/src/bin/miri.rs +++ b/src/tools/miri/src/bin/miri.rs @@ -192,10 +192,7 @@ fn init_late_loggers(tcx: TyCtxt<'_>) { if log::Level::from_str(&var).is_ok() { env::set_var( "RUSTC_LOG", - format!( - "rustc_middle::mir::interpret={0},rustc_const_eval::interpret={0}", - var - ), + format!("rustc_middle::mir::interpret={var},rustc_const_eval::interpret={var}"), ); } else { env::set_var("RUSTC_LOG", &var); diff --git a/src/tools/miri/src/concurrency/vector_clock.rs b/src/tools/miri/src/concurrency/vector_clock.rs index e7e5b35ac2c..ba04991a588 100644 --- a/src/tools/miri/src/concurrency/vector_clock.rs +++ b/src/tools/miri/src/concurrency/vector_clock.rs @@ -404,67 +404,49 @@ mod tests { assert_eq!( alt_compare, o.map(Ordering::reverse), - "Invalid alt comparison\n l: {:?}\n r: {:?}", - l, - r + "Invalid alt comparison\n l: {l:?}\n r: {r:?}" ); //Test operators with faster implementations assert_eq!( matches!(compare, Some(Ordering::Less)), l < r, - "Invalid (<):\n l: {:?}\n r: {:?}", - l, - r + "Invalid (<):\n l: {l:?}\n r: {r:?}" ); assert_eq!( matches!(compare, Some(Ordering::Less) | Some(Ordering::Equal)), l <= r, - "Invalid (<=):\n l: {:?}\n r: {:?}", - l, - r + "Invalid (<=):\n l: {l:?}\n r: {r:?}" ); assert_eq!( matches!(compare, Some(Ordering::Greater)), l > r, - "Invalid (>):\n l: {:?}\n r: {:?}", - l, - r + "Invalid (>):\n l: {l:?}\n r: {r:?}" ); assert_eq!( matches!(compare, Some(Ordering::Greater) | Some(Ordering::Equal)), l >= r, - "Invalid (>=):\n l: {:?}\n r: {:?}", - l, - r + "Invalid (>=):\n l: {l:?}\n r: {r:?}" ); assert_eq!( matches!(alt_compare, Some(Ordering::Less)), r < l, - "Invalid alt (<):\n l: {:?}\n r: {:?}", - l, - r + "Invalid alt (<):\n l: {l:?}\n r: {r:?}" ); assert_eq!( matches!(alt_compare, Some(Ordering::Less) | Some(Ordering::Equal)), r <= l, - "Invalid alt (<=):\n l: {:?}\n r: {:?}", - l, - r + "Invalid alt (<=):\n l: {l:?}\n r: {r:?}" ); assert_eq!( matches!(alt_compare, Some(Ordering::Greater)), r > l, - "Invalid alt (>):\n l: {:?}\n r: {:?}", - l, - r + "Invalid alt (>):\n l: {l:?}\n r: {r:?}" ); assert_eq!( matches!(alt_compare, Some(Ordering::Greater) | Some(Ordering::Equal)), r >= l, - "Invalid alt (>=):\n l: {:?}\n r: {:?}", - l, - r + "Invalid alt (>=):\n l: {l:?}\n r: {r:?}" ); } } diff --git a/src/tools/miri/src/helpers.rs b/src/tools/miri/src/helpers.rs index 8f6a5fbc1f0..7fb2539ca5a 100644 --- a/src/tools/miri/src/helpers.rs +++ b/src/tools/miri/src/helpers.rs @@ -554,9 +554,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> { assert_eq!( self.eval_context_ref().tcx.sess.target.os, target_os, - "`{}` is only available on the `{}` target OS", - name, - target_os, + "`{name}` is only available on the `{target_os}` target OS", ) } @@ -566,8 +564,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> { fn assert_target_os_is_unix(&self, name: &str) { assert!( target_os_is_unix(self.eval_context_ref().tcx.sess.target.os.as_ref()), - "`{}` is only available for supported UNIX family targets", - name, + "`{name}` is only available for supported UNIX family targets", ); } @@ -1019,8 +1016,7 @@ where pub fn isolation_abort_error<'tcx>(name: &str) -> InterpResult<'tcx> { throw_machine_stop!(TerminationInfo::UnsupportedInIsolation(format!( - "{} not available when isolation is enabled", - name, + "{name} not available when isolation is enabled", ))) } diff --git a/src/tools/miri/src/shims/foreign_items.rs b/src/tools/miri/src/shims/foreign_items.rs index f72521f64ad..8370e02b588 100644 --- a/src/tools/miri/src/shims/foreign_items.rs +++ b/src/tools/miri/src/shims/foreign_items.rs @@ -299,8 +299,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> { return Ok(Some(body)); } this.handle_unsupported(format!( - "can't call (diverging) foreign function: {}", - link_name + "can't call (diverging) foreign function: {link_name}" ))?; return Ok(None); } |
