Rollup merge of #100351 - compiler-errors:diagnostic-convention, r=fee1-dead

Use `&mut Diagnostic` instead of `&mut DiagnosticBuilder` unless needed

This seems to be the established convention (02ff9e0) when `DiagnosticBuilder` was first added. I am guilty of introducing some of these.
This commit is contained in:
Dylan DPC 2022-08-11 22:47:03 +05:30 committed by GitHub
commit b5f5bdce87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 37 additions and 59 deletions

View file

@ -2021,9 +2021,9 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
fn suggest_introducing_lifetime(
&self,
err: &mut DiagnosticBuilder<'_, ErrorGuaranteed>,
err: &mut Diagnostic,
name: Option<&str>,
suggest: impl Fn(&mut DiagnosticBuilder<'_, ErrorGuaranteed>, bool, Span, &str, String) -> bool,
suggest: impl Fn(&mut Diagnostic, bool, Span, &str, String) -> bool,
) {
let mut suggest_note = true;
for rib in self.lifetime_ribs.iter().rev() {
@ -2149,7 +2149,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
pub(crate) fn add_missing_lifetime_specifiers_label(
&mut self,
err: &mut DiagnosticBuilder<'_, ErrorGuaranteed>,
err: &mut Diagnostic,
lifetime_refs: Vec<MissingLifetime>,
function_param_lifetimes: Option<(Vec<MissingLifetime>, Vec<ElisionFnParameter>)>,
) {