From 6d8959ea8374376ee38c972c61e8bfdacb71724f Mon Sep 17 00:00:00 2001 From: Alex Macleod Date: Fri, 16 Sep 2022 21:04:38 +0000 Subject: [PATCH] Add `#[allow(unused)]` to test in `cargo dev new_lint` --- book/src/development/adding_lints.md | 1 + clippy_dev/src/new_lint.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/book/src/development/adding_lints.md b/book/src/development/adding_lints.md index da781eb970df7..b1e843bc7f4c8 100644 --- a/book/src/development/adding_lints.md +++ b/book/src/development/adding_lints.md @@ -90,6 +90,7 @@ We start by opening the test file created at `tests/ui/foo_functions.rs`. Update the file with some examples to get started: ```rust +#![allow(unused)] #![warn(clippy::foo_functions)] // Impl methods diff --git a/clippy_dev/src/new_lint.rs b/clippy_dev/src/new_lint.rs index be05e67d724df..9a68c6e775d87 100644 --- a/clippy_dev/src/new_lint.rs +++ b/clippy_dev/src/new_lint.rs @@ -186,6 +186,7 @@ pub(crate) fn get_stabilization_version() -> String { fn get_test_file_contents(lint_name: &str, header_commands: Option<&str>) -> String { let mut contents = format!( indoc! {" + #![allow(unused)] #![warn(clippy::{})] fn main() {{