Skip to content

Commit aa5d95e

Browse files
committed
Use expect for lint warnings
1 parent 828ee51 commit aa5d95e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+43
-68
lines changed

clippy_config/src/conf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ macro_rules! define_Conf {
248248

249249
#[derive(Deserialize)]
250250
#[serde(field_identifier, rename_all = "kebab-case")]
251-
#[allow(non_camel_case_types)]
251+
#[expect(non_camel_case_types)]
252252
enum Field { $($name,)* third_party, }
253253

254254
struct ConfVisitor<'a>(&'a SourceFile);
@@ -1210,7 +1210,7 @@ mod tests {
12101210

12111211
for entry in toml_files {
12121212
let file = fs::read_to_string(entry.path()).unwrap();
1213-
#[allow(clippy::zero_sized_map_values)]
1213+
#[expect(clippy::zero_sized_map_values)]
12141214
if let Ok(map) = toml::from_str::<HashMap<String, IgnoredAny>>(&file) {
12151215
for name in map.keys() {
12161216
names.remove(name.as_str());

clippy_config/src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl DisallowedPathEnum {
131131
}
132132

133133
/// Creates a map of disallowed items to the reason they were disallowed.
134-
#[allow(clippy::type_complexity)]
134+
#[expect(clippy::type_complexity)]
135135
pub fn create_disallowed_map<const REPLACEMENT_ALLOWED: bool>(
136136
tcx: TyCtxt<'_>,
137137
disallowed_paths: &'static [DisallowedPath<REPLACEMENT_ALLOWED>],

clippy_dev/src/dogfood.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use itertools::Itertools;
44
/// # Panics
55
///
66
/// Panics if unable to run the dogfood test
7-
#[allow(clippy::fn_params_excessive_bools)]
7+
#[expect(clippy::fn_params_excessive_bools)]
88
pub fn dogfood(fix: bool, allow_dirty: bool, allow_staged: bool, allow_no_vcs: bool) {
99
run_exit_on_err(
1010
"cargo test",

clippy_dev/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ enum DevCommand {
192192
/// Which lint's page to load initially (optional)
193193
lint: Option<String>,
194194
},
195-
#[allow(clippy::doc_markdown)]
195+
#[expect(clippy::doc_markdown)]
196196
/// Manually run clippy on a file or package
197197
///
198198
/// ## Examples

clippy_dev/src/new_lint.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,6 @@ fn create_lint_for_ty(lint: &LintData<'_>, enable_msrv: bool, ty: &str) -> io::R
443443
Ok(())
444444
}
445445

446-
#[allow(clippy::too_many_lines)]
447446
fn setup_mod_file(path: &Path, lint: &LintData<'_>) -> io::Result<&'static str> {
448447
let lint_name_upper = lint.name.to_uppercase();
449448

clippy_lints/src/arbitrary_source_item_ordering.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ declare_clippy_lint! {
167167
impl_lint_pass!(ArbitrarySourceItemOrdering => [ARBITRARY_SOURCE_ITEM_ORDERING]);
168168

169169
#[derive(Debug)]
170-
#[allow(clippy::struct_excessive_bools)] // Bools are cached feature flags.
170+
#[expect(clippy::struct_excessive_bools)] // Bools are cached feature flags.
171171
pub struct ArbitrarySourceItemOrdering {
172172
assoc_types_order: SourceItemOrderingTraitAssocItemKinds,
173173
enable_ordering_for_enum: bool,

clippy_lints/src/deprecated_lints.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ macro_rules! declare_with_version {
77
$e:expr,
88
)*]) => {
99
pub static $name: &[(&str, &str)] = &[$($e),*];
10-
#[allow(unused)]
1110
pub static $name_version: &[&str] = &[$($version),*];
1211
};
1312
}

clippy_lints/src/doc/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ fn check_for_code_clusters<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a
968968
/// This walks the "events" (think sections of markdown) produced by `pulldown_cmark`,
969969
/// so lints here will generally access that information.
970970
/// Returns documentation headers -- whether a "Safety", "Errors", "Panic" section was found
971-
#[allow(clippy::too_many_lines)] // Only a big match statement
971+
#[expect(clippy::too_many_lines)] // Only a big match statement
972972
fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize>)>>(
973973
cx: &LateContext<'_>,
974974
valid_idents: &FxHashSet<String>,

clippy_lints/src/eta_reduction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl<'tcx> LateLintPass<'tcx> for EtaReduction {
8686
}
8787
}
8888

89-
#[allow(clippy::too_many_lines)]
89+
#[expect(clippy::too_many_lines)]
9090
fn check_closure<'tcx>(cx: &LateContext<'tcx>, outer_receiver: Option<&Expr<'tcx>>, expr: &Expr<'tcx>) {
9191
let body = if let ExprKind::Closure(c) = expr.kind
9292
&& c.fn_decl.inputs.iter().all(|ty| matches!(ty.kind, TyKind::Infer(())))

clippy_lints/src/format.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ declare_clippy_lint! {
3939
"useless use of `format!`"
4040
}
4141

42-
#[allow(clippy::module_name_repetitions)]
4342
pub struct UselessFormat {
4443
format_args: FormatArgsStorage,
4544
}

0 commit comments

Comments
 (0)