Skip to content

Commit

Permalink
Tune lints for 1.80 Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
tyranron committed Jul 26, 2024
1 parent 4a3114a commit 5f0f8ad
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 6 deletions.
8 changes: 4 additions & 4 deletions codegen/impl/src/es/event/impl_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ mod spec {
Ok(Definition::try_from(input)?.into_token_stream())
}

#[allow(clippy::too_many_lines)]
#[allow(clippy::too_many_lines)] // OK for macro expansion test
#[test]
fn derives_enum_impl() {
let input = parse_quote! {
Expand Down Expand Up @@ -582,7 +582,7 @@ mod spec {
assert_eq!(derive(input).unwrap().to_string(), output.to_string());
}

#[allow(clippy::too_many_lines)]
#[allow(clippy::too_many_lines)] // OK for macro expansion test
#[test]
fn derives_enum_impl_with_revision() {
let input = parse_quote! {
Expand Down Expand Up @@ -712,7 +712,7 @@ mod spec {
assert_eq!(derive(input).unwrap().to_string(), output.to_string());
}

#[allow(clippy::too_many_lines)]
#[allow(clippy::too_many_lines)] // OK for macro expansion test
#[test]
fn derives_enum_with_generics_impl() {
let input = parse_quote! {
Expand Down Expand Up @@ -860,7 +860,7 @@ mod spec {
assert_eq!(derive(input).unwrap().to_string(), output.to_string());
}

#[allow(clippy::too_many_lines)]
#[allow(clippy::too_many_lines)] // OK for macro expansion test
#[test]
fn ignores_ignored_variant() {
let input_ignore = parse_quote! {
Expand Down
2 changes: 2 additions & 0 deletions codegen/impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
clippy::read_zero_byte_vec,
clippy::redundant_clone,
clippy::redundant_type_annotations,
clippy::renamed_function_params,
clippy::ref_patterns,
clippy::rest_pat_in_fully_bound_structs,
clippy::same_name_method,
Expand Down Expand Up @@ -117,6 +118,7 @@
clippy::use_self,
clippy::useless_let_if_seq,
clippy::verbose_file_reads,
clippy::while_float,
clippy::wildcard_enum_match_arm,
explicit_outlives_requirements,
future_incompatible,
Expand Down
2 changes: 2 additions & 0 deletions codegen/shim/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
clippy::read_zero_byte_vec,
clippy::redundant_clone,
clippy::redundant_type_annotations,
clippy::renamed_function_params,
clippy::ref_patterns,
clippy::rest_pat_in_fully_bound_structs,
clippy::same_name_method,
Expand Down Expand Up @@ -117,6 +118,7 @@
clippy::use_self,
clippy::useless_let_if_seq,
clippy::verbose_file_reads,
clippy::while_float,
clippy::wildcard_enum_match_arm,
explicit_outlives_requirements,
future_incompatible,
Expand Down
4 changes: 2 additions & 2 deletions codegen/src/es/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ pub const fn concat_slices<T: Copy, const LEN: usize>(
total_len += input[i].len();
// error: cannot borrow here, since the borrowed element may contain
// interior mutability
#[allow(clippy::redundant_pattern_matching)]
#[allow(clippy::redundant_pattern_matching)] // false positive
if matches!(first_elem, None) && total_len > 0 {
first_elem = Some(input[i][0]);
}
i += 1;
}
// TODO: Use `assert_ne!()` here, once it's allowed in `const` context.
#[allow(clippy::manual_assert)]
#[allow(clippy::manual_assert)] // const context
if total_len != LEN {
panic!("actual slices lengths mismatches the specified `LEN` const")
}
Expand Down
2 changes: 2 additions & 0 deletions codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
clippy::read_zero_byte_vec,
clippy::redundant_clone,
clippy::redundant_type_annotations,
clippy::renamed_function_params,
clippy::ref_patterns,
clippy::rest_pat_in_fully_bound_structs,
clippy::same_name_method,
Expand Down Expand Up @@ -117,6 +118,7 @@
clippy::use_self,
clippy::useless_let_if_seq,
clippy::verbose_file_reads,
clippy::while_float,
clippy::wildcard_enum_match_arm,
explicit_outlives_requirements,
future_incompatible,
Expand Down
2 changes: 2 additions & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
clippy::read_zero_byte_vec,
clippy::redundant_clone,
clippy::redundant_type_annotations,
clippy::renamed_function_params,
clippy::ref_patterns,
clippy::rest_pat_in_fully_bound_structs,
clippy::same_name_method,
Expand Down Expand Up @@ -117,6 +118,7 @@
clippy::use_self,
clippy::useless_let_if_seq,
clippy::verbose_file_reads,
clippy::while_float,
clippy::wildcard_enum_match_arm,
explicit_outlives_requirements,
future_incompatible,
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
clippy::read_zero_byte_vec,
clippy::redundant_clone,
clippy::redundant_type_annotations,
clippy::renamed_function_params,
clippy::ref_patterns,
clippy::rest_pat_in_fully_bound_structs,
clippy::same_name_method,
Expand Down Expand Up @@ -117,6 +118,7 @@
clippy::use_self,
clippy::useless_let_if_seq,
clippy::verbose_file_reads,
clippy::while_float,
clippy::wildcard_enum_match_arm,
explicit_outlives_requirements,
future_incompatible,
Expand Down

0 comments on commit 5f0f8ad

Please sign in to comment.