Replace &mut DiagnosticBuilder
, in signatures, with &mut Diagnostic
.
This commit is contained in:
parent
f24ff1815f
commit
02ff9e0aef
65 changed files with 369 additions and 466 deletions
|
@ -3,7 +3,7 @@
|
|||
|
||||
use super::StringReader;
|
||||
use crate::token;
|
||||
use rustc_errors::{Applicability, DiagnosticBuilder};
|
||||
use rustc_errors::{Applicability, Diagnostic};
|
||||
use rustc_span::{symbol::kw, BytePos, Pos, Span};
|
||||
|
||||
#[rustfmt::skip] // for line breaks
|
||||
|
@ -336,7 +336,7 @@ pub(super) fn check_for_substitution<'a>(
|
|||
reader: &StringReader<'a>,
|
||||
pos: BytePos,
|
||||
ch: char,
|
||||
err: &mut DiagnosticBuilder<'a>,
|
||||
err: &mut Diagnostic,
|
||||
) -> Option<token::TokenKind> {
|
||||
let Some(&(_u_char, u_name, ascii_char)) = UNICODE_ARRAY.iter().find(|&&(c, _, _)| c == ch) else {
|
||||
return None;
|
||||
|
|
|
@ -3,7 +3,7 @@ use rustc_ast as ast;
|
|||
use rustc_ast::attr;
|
||||
use rustc_ast::token::{self, Nonterminal};
|
||||
use rustc_ast_pretty::pprust;
|
||||
use rustc_errors::{error_code, DiagnosticBuilder, PResult};
|
||||
use rustc_errors::{error_code, Diagnostic, PResult};
|
||||
use rustc_span::{sym, BytePos, Span};
|
||||
use std::convert::TryInto;
|
||||
|
||||
|
@ -147,7 +147,7 @@ impl<'a> Parser<'a> {
|
|||
|
||||
fn annotate_following_item_if_applicable(
|
||||
&self,
|
||||
err: &mut DiagnosticBuilder<'_>,
|
||||
err: &mut Diagnostic,
|
||||
span: Span,
|
||||
attr_type: OuterAttributeType,
|
||||
) -> Option<Span> {
|
||||
|
|
|
@ -16,7 +16,7 @@ use rustc_ast::{
|
|||
};
|
||||
use rustc_ast_pretty::pprust;
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
use rustc_errors::{pluralize, struct_span_err};
|
||||
use rustc_errors::{pluralize, struct_span_err, Diagnostic};
|
||||
use rustc_errors::{Applicability, DiagnosticBuilder, Handler, PResult};
|
||||
use rustc_span::source_map::Spanned;
|
||||
use rustc_span::symbol::{kw, Ident};
|
||||
|
@ -393,7 +393,7 @@ impl<'a> Parser<'a> {
|
|||
Err(err)
|
||||
}
|
||||
|
||||
fn check_too_many_raw_str_terminators(&mut self, err: &mut DiagnosticBuilder<'_>) -> bool {
|
||||
fn check_too_many_raw_str_terminators(&mut self, err: &mut Diagnostic) -> bool {
|
||||
match (&self.prev_token.kind, &self.token.kind) {
|
||||
(
|
||||
TokenKind::Literal(Lit {
|
||||
|
@ -483,7 +483,7 @@ impl<'a> Parser<'a> {
|
|||
|
||||
pub fn maybe_annotate_with_ascription(
|
||||
&mut self,
|
||||
err: &mut DiagnosticBuilder<'_>,
|
||||
err: &mut Diagnostic,
|
||||
maybe_expected_semicolon: bool,
|
||||
) {
|
||||
if let Some((sp, likely_path)) = self.last_type_ascription.take() {
|
||||
|
@ -767,7 +767,7 @@ impl<'a> Parser<'a> {
|
|||
/// parenthesising the leftmost comparison.
|
||||
fn attempt_chained_comparison_suggestion(
|
||||
&mut self,
|
||||
err: &mut DiagnosticBuilder<'_>,
|
||||
err: &mut Diagnostic,
|
||||
inner_op: &Expr,
|
||||
outer_op: &Spanned<AssocOp>,
|
||||
) -> bool /* advanced the cursor */ {
|
||||
|
@ -890,7 +890,7 @@ impl<'a> Parser<'a> {
|
|||
"comparison operators cannot be chained",
|
||||
);
|
||||
|
||||
let suggest = |err: &mut DiagnosticBuilder<'_>| {
|
||||
let suggest = |err: &mut Diagnostic| {
|
||||
err.span_suggestion_verbose(
|
||||
op.span.shrink_to_lo(),
|
||||
TURBOFISH_SUGGESTION_STR,
|
||||
|
@ -1637,7 +1637,7 @@ impl<'a> Parser<'a> {
|
|||
|
||||
pub(super) fn parameter_without_type(
|
||||
&mut self,
|
||||
err: &mut DiagnosticBuilder<'_>,
|
||||
err: &mut Diagnostic,
|
||||
pat: P<ast::Pat>,
|
||||
require_name: bool,
|
||||
first_param: bool,
|
||||
|
|
|
@ -17,7 +17,7 @@ use rustc_ast::{self as ast, AttrStyle, AttrVec, CaptureBy, ExprField, Lit, UnOp
|
|||
use rustc_ast::{AnonConst, BinOp, BinOpKind, FnDecl, FnRetTy, MacCall, Param, Ty, TyKind};
|
||||
use rustc_ast::{Arm, Async, BlockCheckMode, Expr, ExprKind, Label, Movability, RangeLimits};
|
||||
use rustc_ast_pretty::pprust;
|
||||
use rustc_errors::{Applicability, DiagnosticBuilder, PResult};
|
||||
use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder, PResult};
|
||||
use rustc_session::lint::builtin::BREAK_WITH_LABEL_AND_LOOP;
|
||||
use rustc_session::lint::BuiltinLintDiagnostics;
|
||||
use rustc_span::edition::LATEST_STABLE_EDITION;
|
||||
|
@ -2653,7 +2653,7 @@ impl<'a> Parser<'a> {
|
|||
let mut base = ast::StructRest::None;
|
||||
let mut recover_async = false;
|
||||
|
||||
let mut async_block_err = |e: &mut DiagnosticBuilder<'_>, span: Span| {
|
||||
let mut async_block_err = |e: &mut Diagnostic, span: Span| {
|
||||
recover_async = true;
|
||||
e.span_label(span, "`async` blocks are only allowed in Rust 2018 or later");
|
||||
e.help(&format!("set `edition = \"{}\"` in `Cargo.toml`", LATEST_STABLE_EDITION));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue