When encountering <&T as Clone>::clone(x) because T: Clone, suggest #[derive(Clone)]

CC #40699.
This commit is contained in:
Esteban Küber
2024-02-22 18:01:12 +00:00
parent 2dc0170233
commit 6017de46f7
6 changed files with 80 additions and 78 deletions

View File

@@ -1314,6 +1314,12 @@ pub struct NoopMethodCallDiag<'a> {
pub trait_: Symbol,
#[suggestion(code = "", applicability = "machine-applicable")]
pub label: Span,
#[suggestion(
lint_derive_suggestion,
code = "#[derive(Clone)]\n",
applicability = "maybe-incorrect"
)]
pub suggest_derive: Option<Span>,
}
#[derive(LintDiagnostic)]