A custom error message for lending iterators

This commit is contained in:
Michael Baikov 2024-05-22 09:26:02 -04:00
parent 464987730a
commit d6e4fe569c
5 changed files with 74 additions and 5 deletions

View file

@ -882,6 +882,15 @@ pub(crate) struct ElidedAnonymousLivetimeReportError {
pub(crate) suggestion: Option<ElidedAnonymousLivetimeReportErrorSuggestion>,
}
#[derive(Diagnostic)]
#[diag(resolve_lending_iterator_report_error)]
pub(crate) struct LendingIteratorReportError {
#[primary_span]
pub(crate) lifetime: Span,
#[note]
pub(crate) ty: Span,
}
#[derive(Subdiagnostic)]
#[multipart_suggestion(
resolve_elided_anonymous_lifetime_report_error_suggestion,