Uplift clippy::undropped_manually_drops to rustc

This commit is contained in:
Urgau 2023-05-12 19:30:15 +02:00
parent a9baa16482
commit 52300bf8d8
5 changed files with 126 additions and 2 deletions

View file

@ -699,6 +699,25 @@ pub struct ForgetCopyDiag<'a> {
pub label: Span,
}
#[derive(LintDiagnostic)]
#[diag(lint_undropped_manually_drops)]
pub struct UndroppedManuallyDropsDiag<'a> {
pub arg_ty: Ty<'a>,
#[label]
pub label: Span,
#[subdiagnostic]
pub suggestion: UndroppedManuallyDropsSuggestion,
}
#[derive(Subdiagnostic)]
#[multipart_suggestion(lint_suggestion, applicability = "machine-applicable")]
pub struct UndroppedManuallyDropsSuggestion {
#[suggestion_part(code = "std::mem::ManuallyDrop::into_inner(")]
pub start_span: Span,
#[suggestion_part(code = ")")]
pub end_span: Span,
}
// invalid_from_utf8.rs
#[derive(LintDiagnostic)]
pub enum InvalidFromUtf8Diag {