Adopt tool attrs for clippy lint level attributes

Requires rustc 1.31+.
This commit is contained in:
David Tolnay 2023-07-31 11:36:51 -07:00
parent 033d05f70b
commit 2023cf345f
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -102,55 +102,51 @@
// https://github.com/serde-rs/serde/issues/812 // https://github.com/serde-rs/serde/issues/812
#![cfg_attr(feature = "unstable", feature(error_in_core, never_type))] #![cfg_attr(feature = "unstable", feature(error_in_core, never_type))]
#![allow(unknown_lints, bare_trait_objects, deprecated)] #![allow(unknown_lints, bare_trait_objects, deprecated)]
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
// Ignored clippy and clippy_pedantic lints // Ignored clippy and clippy_pedantic lints
#![cfg_attr( #![allow(
feature = "cargo-clippy", // clippy bug: https://github.com/rust-lang/rust-clippy/issues/5704
allow( clippy::unnested_or_patterns,
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/5704 // clippy bug: https://github.com/rust-lang/rust-clippy/issues/7768
unnested_or_patterns, clippy::semicolon_if_nothing_returned,
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/7768 // not available in our oldest supported compiler
semicolon_if_nothing_returned, clippy::empty_enum,
// not available in our oldest supported compiler clippy::type_repetition_in_bounds, // https://github.com/rust-lang/rust-clippy/issues/8772
empty_enum, // integer and float ser/de requires these sorts of casts
type_repetition_in_bounds, // https://github.com/rust-lang/rust-clippy/issues/8772 clippy::cast_possible_truncation,
// integer and float ser/de requires these sorts of casts clippy::cast_possible_wrap,
cast_possible_truncation, clippy::cast_sign_loss,
cast_possible_wrap, // things are often more readable this way
cast_sign_loss, clippy::cast_lossless,
// things are often more readable this way clippy::module_name_repetitions,
cast_lossless, clippy::option_if_let_else,
module_name_repetitions, clippy::single_match_else,
option_if_let_else, clippy::type_complexity,
single_match_else, clippy::use_self,
type_complexity, clippy::zero_prefixed_literal,
use_self, // correctly used
zero_prefixed_literal, clippy::derive_partial_eq_without_eq,
// correctly used clippy::enum_glob_use,
derive_partial_eq_without_eq, clippy::explicit_auto_deref,
enum_glob_use, clippy::let_underscore_untyped,
explicit_auto_deref, clippy::map_err_ignore,
let_underscore_untyped, clippy::new_without_default,
map_err_ignore, clippy::result_unit_err,
new_without_default, clippy::wildcard_imports,
result_unit_err, // not practical
wildcard_imports, clippy::needless_pass_by_value,
// not practical clippy::similar_names,
needless_pass_by_value, clippy::too_many_lines,
similar_names, // preference
too_many_lines, clippy::doc_markdown,
// preference clippy::unseparated_literal_suffix,
doc_markdown, // false positive
unseparated_literal_suffix, clippy::needless_doctest_main,
// false positive // noisy
needless_doctest_main, clippy::missing_errors_doc,
// noisy clippy::must_use_candidate,
missing_errors_doc,
must_use_candidate,
)
)] )]
// Restrictions // Restrictions
#![cfg_attr(feature = "cargo-clippy", deny(question_mark_used))] #![deny(clippy::question_mark_used)]
// Rustc lints. // Rustc lints.
#![deny(missing_docs, unused_imports)] #![deny(missing_docs, unused_imports)]