Lint against more useless #[must_use] attributes

This expands the existing `#[must_use]` check in `unused_attributes`
to lint against pretty much everything `#[must_use]` doesn't support.
Fixes #93906.
This commit is contained in:
Ruby Lazuli 2022-02-11 18:21:02 -06:00
parent 6499c5e7fc
commit 6dcf5d8fde
No known key found for this signature in database
GPG key ID: F7E7992881AB576D
6 changed files with 527 additions and 164 deletions

View file

@ -587,7 +587,6 @@ impl<'a> SessionDiagnosticDeriveBuilder<'a> {
// next call to `it.next()` retrieves the next character.
while let Some(c) = it.next() {
if c == '{' && *it.peek().unwrap_or(&'\0') != '{' {
#[must_use]
let mut eat_argument = || -> Option<String> {
let mut result = String::new();
// Format specifiers look like