Skip to content

Commit 4f31983

Browse files
committed
clippy
1 parent dd79e16 commit 4f31983

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/shims/os_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
7474
'mir: 'a,
7575
{
7676
#[cfg(windows)]
77-
pub fn u16vec_to_osstring<'tcx, 'a>(u16_vec: Vec<u16>) -> InterpResult<'tcx, OsString> {
77+
pub fn u16vec_to_osstring<'tcx>(u16_vec: Vec<u16>) -> InterpResult<'tcx, OsString> {
7878
Ok(OsString::from_wide(&u16_vec[..]))
7979
}
8080
#[cfg(not(windows))]

src/shims/windows/handle.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ impl Handle {
6262
let floor_log2 = variant_count.ilog2();
6363

6464
// we need to add one for non powers of two to compensate for the difference
65-
let ceil_log2 = if variant_count.is_power_of_two() { floor_log2 } else { floor_log2 + 1 };
66-
67-
ceil_log2
65+
if variant_count.is_power_of_two() { floor_log2 } else { floor_log2 + 1 }
6866
}
6967

7068
/// Converts a handle into its machine representation.
@@ -120,6 +118,7 @@ impl Handle {
120118
pub fn to_scalar(self, cx: &impl HasDataLayout) -> Scalar<Provenance> {
121119
// 64-bit handles are sign extended 32-bit handles
122120
// see https://docs.microsoft.com/en-us/windows/win32/winprog64/interprocess-communication
121+
#[allow(clippy::cast_possible_wrap)] // we want it to wrap
123122
let signed_handle = self.to_packed() as i32;
124123
Scalar::from_machine_isize(signed_handle.into(), cx)
125124
}
@@ -130,6 +129,7 @@ impl Handle {
130129
) -> InterpResult<'tcx, Option<Self>> {
131130
let sign_extended_handle = handle.to_machine_isize(cx)?;
132131

132+
#[allow(clippy::cast_sign_loss)] // we want to lose the sign
133133
let handle = if let Ok(signed_handle) = i32::try_from(sign_extended_handle) {
134134
signed_handle as u32
135135
} else {

0 commit comments

Comments
 (0)