diff --git a/serde/src/lib.rs b/serde/src/lib.rs index bf5548a8..a66a5af1 100644 --- a/serde/src/lib.rs +++ b/serde/src/lib.rs @@ -91,12 +91,37 @@ #![cfg_attr(feature = "unstable", feature(nonzero, specialization))] #![cfg_attr(feature = "alloc", feature(alloc))] -// Whitelisted clippy lints. -#![cfg_attr(feature = "cargo-clippy", allow(doc_markdown))] -#![cfg_attr(feature = "cargo-clippy", allow(linkedlist))] -#![cfg_attr(feature = "cargo-clippy", allow(type_complexity))] -#![cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] -#![cfg_attr(feature = "cargo-clippy", allow(zero_prefixed_literal))] +#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))] +// Whitelisted clippy lints +#![cfg_attr(feature = "cargo-clippy", allow( + doc_markdown, + linkedlist, + type_complexity, + unreadable_literal, + zero_prefixed_literal, +))] +// Whitelisted clippy_pedantic lints +#![cfg_attr(feature = "cargo-clippy", allow( +// integer and float ser/de requires these sorts of casts + cast_possible_truncation, + cast_possible_wrap, + cast_precision_loss, + cast_sign_loss, +// simplifies some macros + invalid_upcast_comparisons, +// things are often more readable this way + option_unwrap_used, + result_unwrap_used, + shadow_reuse, + single_match_else, + stutter, + use_self, +// not practical + missing_docs_in_private_items, +// alternative is not stable + empty_enum, + use_debug, +))] // Blacklisted Rust lints. #![deny(missing_docs, unused_imports)]