Skip to content

Commit e120fb1

Browse files
committed
Auto merge of #9488 - Alexendoo:unused, r=llogiq
Add `#[allow(unused)]` to test in `cargo dev new_lint` `rustfix` tests don't automatically apply `-Aunused` which leads to some tests having `_workarounds`, add it to new test files automatically so people don't have to worry about it changelog: none
2 parents 481dc2e + 6d8959e commit e120fb1

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

book/src/development/adding_lints.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ We start by opening the test file created at `tests/ui/foo_functions.rs`.
9090
Update the file with some examples to get started:
9191

9292
```rust
93+
#![allow(unused)]
9394
#![warn(clippy::foo_functions)]
9495

9596
// Impl methods

clippy_dev/src/new_lint.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ pub(crate) fn get_stabilization_version() -> String {
186186
fn get_test_file_contents(lint_name: &str, header_commands: Option<&str>) -> String {
187187
let mut contents = format!(
188188
indoc! {"
189+
#![allow(unused)]
189190
#![warn(clippy::{})]
190191
191192
fn main() {{

0 commit comments

Comments
 (0)