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 d84567c0ff
commit 4026fd735c
2 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@
use rustc_ast::token::TokenKind;
use rustc_ast::{ast, attr, ptr};
use rustc_errors::DiagnosticBuilder;
use rustc_errors::Diag;
use rustc_parse::{new_parser_from_file, parser::Parser as RawParser};
use rustc_span::{sym, Span};
use thin_vec::ThinVec;
@ -65,7 +65,7 @@ pub(crate) fn build(self) -> Result<Parser<'a>, ParserError> {
fn parser(
sess: &'a rustc_session::parse::ParseSess,
input: Input,
) -> Result<rustc_parse::parser::Parser<'a>, Option<Vec<DiagnosticBuilder<'a>>>> {
) -> Result<rustc_parse::parser::Parser<'a>, Option<Vec<Diag<'a>>>> {
match input {
Input::File(ref file) => catch_unwind(AssertUnwindSafe(move || {
new_parser_from_file(sess, file, None)

View File

@ -6,7 +6,7 @@
use rustc_errors::emitter::{DynEmitter, Emitter, HumanEmitter};
use rustc_errors::translation::Translate;
use rustc_errors::{
ColorConfig, DiagCtxt, DiagInner, DiagnosticBuilder, ErrorGuaranteed, Level as DiagnosticLevel,
ColorConfig, Diag, DiagCtxt, DiagInner, ErrorGuaranteed, Level as DiagnosticLevel,
};
use rustc_session::parse::ParseSess as RawParseSess;
use rustc_span::{
@ -300,7 +300,7 @@ pub(crate) fn get_original_snippet(&self, file_name: &FileName) -> Option<Lrc<St
// Methods that should be restricted within the parse module.
impl ParseSess {
pub(super) fn emit_diagnostics(&self, diagnostics: Vec<DiagnosticBuilder<'_>>) {
pub(super) fn emit_diagnostics(&self, diagnostics: Vec<Diag<'_>>) {
for diagnostic in diagnostics {
diagnostic.emit();
}