Skip to content

Commit

Permalink
Ignore uninlined_format_args pedantic clippy lint false positive
Browse files Browse the repository at this point in the history
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}"),
         |                              +++++
  • Loading branch information
dtolnay committed Oct 8, 2022
1 parent d96e181 commit f803b29
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test_suite/tests/test_de.rs
Expand Up @@ -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))]
Expand Down

0 comments on commit f803b29

Please sign in to comment.