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:
parent
d84567c0ff
commit
4026fd735c
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
use rustc_ast::token::TokenKind;
|
use rustc_ast::token::TokenKind;
|
||||||
use rustc_ast::{ast, attr, ptr};
|
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_parse::{new_parser_from_file, parser::Parser as RawParser};
|
||||||
use rustc_span::{sym, Span};
|
use rustc_span::{sym, Span};
|
||||||
use thin_vec::ThinVec;
|
use thin_vec::ThinVec;
|
||||||
@ -65,7 +65,7 @@ pub(crate) fn build(self) -> Result<Parser<'a>, ParserError> {
|
|||||||
fn parser(
|
fn parser(
|
||||||
sess: &'a rustc_session::parse::ParseSess,
|
sess: &'a rustc_session::parse::ParseSess,
|
||||||
input: Input,
|
input: Input,
|
||||||
) -> Result<rustc_parse::parser::Parser<'a>, Option<Vec<DiagnosticBuilder<'a>>>> {
|
) -> Result<rustc_parse::parser::Parser<'a>, Option<Vec<Diag<'a>>>> {
|
||||||
match input {
|
match input {
|
||||||
Input::File(ref file) => catch_unwind(AssertUnwindSafe(move || {
|
Input::File(ref file) => catch_unwind(AssertUnwindSafe(move || {
|
||||||
new_parser_from_file(sess, file, None)
|
new_parser_from_file(sess, file, None)
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
use rustc_errors::emitter::{DynEmitter, Emitter, HumanEmitter};
|
use rustc_errors::emitter::{DynEmitter, Emitter, HumanEmitter};
|
||||||
use rustc_errors::translation::Translate;
|
use rustc_errors::translation::Translate;
|
||||||
use rustc_errors::{
|
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_session::parse::ParseSess as RawParseSess;
|
||||||
use rustc_span::{
|
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.
|
// Methods that should be restricted within the parse module.
|
||||||
impl ParseSess {
|
impl ParseSess {
|
||||||
pub(super) fn emit_diagnostics(&self, diagnostics: Vec<DiagnosticBuilder<'_>>) {
|
pub(super) fn emit_diagnostics(&self, diagnostics: Vec<Diag<'_>>) {
|
||||||
for diagnostic in diagnostics {
|
for diagnostic in diagnostics {
|
||||||
diagnostic.emit();
|
diagnostic.emit();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user