diff --git a/src/tools/miri/src/lib.rs b/src/tools/miri/src/lib.rs index 461f6e4c0f6..8e2222c39a2 100644 --- a/src/tools/miri/src/lib.rs +++ b/src/tools/miri/src/lib.rs @@ -28,6 +28,7 @@ clippy::type_complexity, clippy::single_element_loop, clippy::needless_return, + clippy::bool_to_int_with_if, // We are not implementing queries here so it's fine rustc::potential_query_instability )] diff --git a/src/tools/miri/src/shims/unix/android/dlsym.rs b/src/tools/miri/src/shims/unix/android/dlsym.rs index 4cb78d4dabd..b0c9d729c9d 100644 --- a/src/tools/miri/src/shims/unix/android/dlsym.rs +++ b/src/tools/miri/src/shims/unix/android/dlsym.rs @@ -42,7 +42,7 @@ fn call_dlsym( ); } - let &[ref _sig, ref _func] = check_arg_count(args)?; + let [_sig, _func] = check_arg_count(args)?; this.write_null(dest)?; } } diff --git a/src/tools/miri/src/shims/unix/fs.rs b/src/tools/miri/src/shims/unix/fs.rs index 9713cd9265e..ed68976773d 100644 --- a/src/tools/miri/src/shims/unix/fs.rs +++ b/src/tools/miri/src/shims/unix/fs.rs @@ -1073,7 +1073,7 @@ fn linux_statx( mask |= this.eval_libc("STATX_ATIME")?.to_u32()?; InterpResult::Ok(tup) }) - .unwrap_or(Ok((0, 0)))?; + .unwrap_or_else(|| Ok((0, 0)))?; let (created_sec, created_nsec) = metadata .created @@ -1081,7 +1081,7 @@ fn linux_statx( mask |= this.eval_libc("STATX_BTIME")?.to_u32()?; InterpResult::Ok(tup) }) - .unwrap_or(Ok((0, 0)))?; + .unwrap_or_else(|| Ok((0, 0)))?; let (modified_sec, modified_nsec) = metadata .modified @@ -1089,7 +1089,7 @@ fn linux_statx( mask |= this.eval_libc("STATX_MTIME")?.to_u32()?; InterpResult::Ok(tup) }) - .unwrap_or(Ok((0, 0)))?; + .unwrap_or_else(|| Ok((0, 0)))?; // Now we write everything to `statxbuf`. We write a zero for the unavailable fields. this.write_int_fields_named( diff --git a/src/tools/miri/src/stacked_borrows/mod.rs b/src/tools/miri/src/stacked_borrows/mod.rs index 2888f8e81fb..09d36ca9dfd 100644 --- a/src/tools/miri/src/stacked_borrows/mod.rs +++ b/src/tools/miri/src/stacked_borrows/mod.rs @@ -45,6 +45,7 @@ pub fn new(i: u64) -> Option { } // The default to be used when SB is disabled + #[allow(clippy::should_implement_trait)] pub fn default() -> Self { Self::new(1).unwrap() }