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
This commit is contained in:
bors 2022-09-17 09:29:17 +00:00
commit e120fb10c6
2 changed files with 2 additions and 0 deletions

View File

@ -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

View File

@ -186,6 +186,7 @@ fn parse_manifest(contents: &str) -> Option<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() {{