From f803b290f3768ef5c22dcd506cb5901a60d650f2 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 7 Oct 2022 21:46:14 -0700 Subject: [PATCH] Ignore uninlined_format_args pedantic clippy lint false positive Clippy's suggested fix is not valid in 2018 edition. The serde_test_suite crate can't be updated to 2021 edition yet because CI of the serde crate on old toolchains needs to be able to parse all manifests in the workspace, even if serde_test_suite is not being compiled in those builds. error: variables can be used directly in the `format!` string --> test_suite/tests/test_de.rs:2260:23 | 2260 | Err(e) => panic!("tokens failed to deserialize: {}", e), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args = note: `-D clippy::uninlined-format-args` implied by `-D clippy::pedantic` help: change this to | 2260 - Err(e) => panic!("tokens failed to deserialize: {}", e), 2260 + Err(e) => panic!("tokens failed to deserialize: {e}"), | warning: unused variable: `e` --> test_suite/tests/test_de.rs:2260:17 | 2260 | Err(e) => panic!("tokens failed to deserialize: {e}"), | ^ help: if this is intentional, prefix it with an underscore: `_e` | = note: `#[warn(unused_variables)]` on by default warning: panic message contains an unused formatting placeholder --> test_suite/tests/test_de.rs:2260:61 | 2260 | Err(e) => panic!("tokens failed to deserialize: {e}"), | ^^^ | = note: this message is not used as a format string when given without arguments, but will be in Rust 2021 = note: `#[warn(non_fmt_panics)]` on by default help: add the missing argument | 2260 | Err(e) => panic!("tokens failed to deserialize: {e}", ...), | +++++ help: or add a "{}" format string to use the message literally | 2260 | Err(e) => panic!("{}", "tokens failed to deserialize: {e}"), | +++++ --- test_suite/tests/test_de.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/test_suite/tests/test_de.rs b/test_suite/tests/test_de.rs index 4be326f4b..226667939 100644 --- a/test_suite/tests/test_de.rs +++ b/test_suite/tests/test_de.rs @@ -5,6 +5,7 @@ clippy::empty_enum, clippy::manual_assert, clippy::needless_pass_by_value, + clippy::uninlined_format_args, clippy::unreadable_literal )] #![cfg_attr(feature = "unstable", feature(never_type))]