Rename DiagnosticBuilder as Diag.

Much better!

Note that this involves renaming (and updating the value of)
`DIAGNOSTIC_BUILDER` in clippy.
This commit is contained in:
Nicholas Nethercote 2024-02-23 10:20:45 +11:00
parent 4e1f9bd528
commit 899cb40809
153 changed files with 1136 additions and 1367 deletions

View file

@ -51,7 +51,7 @@ impl<'a> DiagnosticDerive<'a> {
Some(slug) => {
slugs.borrow_mut().push(slug.clone());
quote! {
let mut diag = rustc_errors::DiagnosticBuilder::new(
let mut diag = rustc_errors::Diag::new(
dcx,
level,
crate::fluent_generated::#slug
@ -83,7 +83,7 @@ impl<'a> DiagnosticDerive<'a> {
self,
dcx: &'_sess rustc_errors::DiagCtxt,
level: rustc_errors::Level
) -> rustc_errors::DiagnosticBuilder<'_sess, G> {
) -> rustc_errors::Diag<'_sess, G> {
#implementation
}
}
@ -160,7 +160,7 @@ impl<'a> LintDiagnosticDerive<'a> {
#[track_caller]
fn decorate_lint<'__b>(
self,
diag: &'__b mut rustc_errors::DiagnosticBuilder<'__a, ()>
diag: &'__b mut rustc_errors::Diag<'__a, ()>
) {
#implementation;
}

View file

@ -14,7 +14,7 @@ impl DiagnosticDeriveError {
match self {
DiagnosticDeriveError::SynError(e) => e.to_compile_error(),
DiagnosticDeriveError::ErrorHandled => {
// Return ! to avoid having to create a blank DiagnosticBuilder to return when an
// Return ! to avoid having to create a blank Diag to return when an
// error has already been emitted to the compiler.
quote! {
{ unreachable!(); }

View file

@ -89,7 +89,7 @@ impl SubdiagnosticDeriveBuilder {
gen impl rustc_errors::AddToDiagnostic for @Self {
fn add_to_diagnostic_with<__G, __F>(
self,
#diag: &mut rustc_errors::DiagnosticBuilder<'_, __G>,
#diag: &mut rustc_errors::Diag<'_, __G>,
#f: __F
) where
__G: rustc_errors::EmissionGuarantee,
@ -108,7 +108,7 @@ impl SubdiagnosticDeriveBuilder {
/// only to be able to destructure and split `self.builder` and the `self.structure` up to avoid a
/// double mut borrow later on.
struct SubdiagnosticDeriveVariantBuilder<'parent, 'a> {
/// The identifier to use for the generated `DiagnosticBuilder` instance.
/// The identifier to use for the generated `Diag` instance.
parent: &'parent SubdiagnosticDeriveBuilder,
/// Info for the current variant (or the type if not an enum).