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:?}"
);
}
}
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",
)
}
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",
);
}
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",
)))
}