Skip to content

Commit 7a66c39

Browse files
authored
Remove some #![expect(clippy::allow_attributes_without_reason)] (#10661)
Clean up some crates by migrating from `#[allow]` to `#[expect]` (ideally) or `#[allow]`-with-reason
1 parent ebc25c8 commit 7a66c39

35 files changed

Lines changed: 48 additions & 116 deletions

File tree

cranelift/interpreter/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
//!
33
//! This module is a project for interpreting Cranelift IR.
44
5-
#![expect(clippy::allow_attributes_without_reason, reason = "crate not migrated")]
6-
75
pub mod address;
86
pub mod environment;
97
pub mod frame;

cranelift/interpreter/src/step.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ fn collect_block_args(
5959
/// Interpret a single Cranelift instruction. Note that program traps and interpreter errors are
6060
/// distinct: a program trap results in `Ok(Flow::Trap(...))` whereas an interpretation error (e.g.
6161
/// the types of two values are incompatible) results in `Err(...)`.
62-
#[allow(unused_variables)]
6362
pub fn step<'a, I>(state: &mut dyn State<'a>, inst_context: I) -> Result<ControlFlow<'a>, StepError>
6463
where
6564
I: InstructionContext,
@@ -123,7 +122,7 @@ where
123122
match mask.len() {
124123
16 => DataValue::V128(mask.try_into().expect("a 16-byte vector mask")),
125124
8 => DataValue::V64(mask.try_into().expect("an 8-byte vector mask")),
126-
length => panic!("unexpected Shuffle mask length {}", mask.len()),
125+
length => panic!("unexpected Shuffle mask length {length}"),
127126
}
128127
}
129128
// 8-bit.
@@ -259,6 +258,7 @@ where
259258
};
260259

261260
// Based on `condition`, indicate where to continue the control flow.
261+
#[expect(unused_variables, reason = "here in case it's needed in the future")]
262262
let branch_when = |condition: bool, block| -> Result<ControlFlow, StepError> {
263263
if condition {
264264
continue_at(block)

cranelift/interpreter/src/value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! The [DataValueExt] trait is an extension trait for [DataValue]. It provides a lot of functions
22
//! used by the rest of the interpreter.
33
4-
#![allow(trivial_numeric_casts)]
4+
#![expect(trivial_numeric_casts, reason = "macro-generated code")]
55

66
use core::fmt::{self, Display, Formatter};
77
use core::ops::Neg;

cranelift/isle/isle/src/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Abstract syntax tree (AST) created from parsed ISLE.
22
3-
#![allow(missing_docs)]
3+
#![expect(missing_docs, reason = "fields mostly self-describing")]
44

55
use crate::lexer::Pos;
66
use crate::log;

cranelift/isle/isle/src/files.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(missing_docs)]
1+
#![expect(missing_docs, reason = "fields mostly self-describing")]
22

33
use crate::codegen::Prefix;
44
use std::ops::Index;

cranelift/isle/isle/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![doc = include_str!("../README.md")]
22
#![deny(missing_docs)]
3-
#![expect(clippy::allow_attributes_without_reason, reason = "crate not migrated")]
43

54
macro_rules! declare_id {
65
(

crates/fiber/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![expect(clippy::allow_attributes, reason = "crate not migrated yet")]
21
#![no_std]
32

43
#[cfg(any(feature = "std", unix, windows))]

crates/wasi-common/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
7070
#![warn(clippy::cast_sign_loss)]
7171
#![cfg_attr(docsrs, feature(doc_cfg))]
72-
#![expect(clippy::allow_attributes_without_reason, reason = "crate not migrated")]
7372

7473
pub mod clocks;
7574
mod ctx;

crates/wasi-common/src/pipe.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// This is mostly stubs
2-
#![allow(unused_variables, dead_code)]
31
//! Virtual pipes.
42
//!
53
//! These types provide easy implementations of `WasiFile` that mimic much of the behavior of Unix

crates/wasi-common/src/snapshots/preview_1/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ fn from_raw_os_error(err: Option<i32>) -> Option<Error> {
124124
RustixErrno::TIMEDOUT => Errno::Timedout.into(),
125125

126126
// On some platforms.into(), these have the same value as other errno values.
127-
#[allow(unreachable_patterns)]
127+
#[allow(unreachable_patterns, reason = "see comment")]
128128
RustixErrno::WOULDBLOCK => Errno::Again.into(),
129-
#[allow(unreachable_patterns)]
129+
#[allow(unreachable_patterns, reason = "see comment")]
130130
RustixErrno::OPNOTSUPP => Errno::Notsup.into(),
131131

132132
_ => return None,

0 commit comments

Comments
 (0)