rename ErrorReported -> ErrorGuaranteed
This commit is contained in:
parent
c42d846add
commit
e489a94dee
112 changed files with 580 additions and 559 deletions
|
@ -10,7 +10,7 @@ use rustc_ast::{self as ast, AstLike, Attribute, Item, NodeId, PatKind};
|
|||
use rustc_attr::{self as attr, Deprecation, Stability};
|
||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
||||
use rustc_data_structures::sync::{self, Lrc};
|
||||
use rustc_errors::{Applicability, DiagnosticBuilder, ErrorReported, PResult};
|
||||
use rustc_errors::{Applicability, DiagnosticBuilder, ErrorGuaranteed, PResult};
|
||||
use rustc_lint_defs::builtin::PROC_MACRO_BACK_COMPAT;
|
||||
use rustc_lint_defs::BuiltinLintDiagnostics;
|
||||
use rustc_parse::{self, nt_to_tokenstream, parser, MACRO_ARGUMENTS};
|
||||
|
@ -275,7 +275,7 @@ pub trait ProcMacro {
|
|||
ecx: &'cx mut ExtCtxt<'_>,
|
||||
span: Span,
|
||||
ts: TokenStream,
|
||||
) -> Result<TokenStream, ErrorReported>;
|
||||
) -> Result<TokenStream, ErrorGuaranteed>;
|
||||
}
|
||||
|
||||
impl<F> ProcMacro for F
|
||||
|
@ -287,7 +287,7 @@ where
|
|||
_ecx: &'cx mut ExtCtxt<'_>,
|
||||
_span: Span,
|
||||
ts: TokenStream,
|
||||
) -> Result<TokenStream, ErrorReported> {
|
||||
) -> Result<TokenStream, ErrorGuaranteed> {
|
||||
// FIXME setup implicit context in TLS before calling self.
|
||||
Ok(self(ts))
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ pub trait AttrProcMacro {
|
|||
span: Span,
|
||||
annotation: TokenStream,
|
||||
annotated: TokenStream,
|
||||
) -> Result<TokenStream, ErrorReported>;
|
||||
) -> Result<TokenStream, ErrorGuaranteed>;
|
||||
}
|
||||
|
||||
impl<F> AttrProcMacro for F
|
||||
|
@ -313,7 +313,7 @@ where
|
|||
_span: Span,
|
||||
annotation: TokenStream,
|
||||
annotated: TokenStream,
|
||||
) -> Result<TokenStream, ErrorReported> {
|
||||
) -> Result<TokenStream, ErrorGuaranteed> {
|
||||
// FIXME setup implicit context in TLS before calling self.
|
||||
Ok(self(annotation, annotated))
|
||||
}
|
||||
|
@ -1076,7 +1076,7 @@ impl<'a> ExtCtxt<'a> {
|
|||
&self,
|
||||
sp: S,
|
||||
msg: &str,
|
||||
) -> DiagnosticBuilder<'a, ErrorReported> {
|
||||
) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
|
||||
self.sess.parse_sess.span_diagnostic.struct_span_err(sp, msg)
|
||||
}
|
||||
|
||||
|
@ -1174,7 +1174,7 @@ pub fn expr_to_spanned_string<'a>(
|
|||
cx: &'a mut ExtCtxt<'_>,
|
||||
expr: P<ast::Expr>,
|
||||
err_msg: &str,
|
||||
) -> Result<(Symbol, ast::StrStyle, Span), Option<(DiagnosticBuilder<'a, ErrorReported>, bool)>> {
|
||||
) -> Result<(Symbol, ast::StrStyle, Span), Option<(DiagnosticBuilder<'a, ErrorGuaranteed>, bool)>> {
|
||||
// Perform eager expansion on the expression.
|
||||
// We want to be able to handle e.g., `concat!("foo", "bar")`.
|
||||
let expr = cx.expander().fully_expand_fragment(AstFragment::Expr(expr)).make_expr();
|
||||
|
|
|
@ -62,7 +62,7 @@ crate fn annotate_err_with_kind(err: &mut Diagnostic, kind: AstFragmentKind, spa
|
|||
}
|
||||
|
||||
fn emit_frag_parse_err(
|
||||
mut e: DiagnosticBuilder<'_, rustc_errors::ErrorReported>,
|
||||
mut e: DiagnosticBuilder<'_, rustc_errors::ErrorGuaranteed>,
|
||||
parser: &Parser<'_>,
|
||||
orig_parser: &mut Parser<'_>,
|
||||
site_span: Span,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::base::ModuleData;
|
||||
use rustc_ast::ptr::P;
|
||||
use rustc_ast::{token, Attribute, Inline, Item};
|
||||
use rustc_errors::{struct_span_err, DiagnosticBuilder, ErrorReported};
|
||||
use rustc_errors::{struct_span_err, DiagnosticBuilder, ErrorGuaranteed};
|
||||
use rustc_parse::new_parser_from_file;
|
||||
use rustc_parse::validate_attr;
|
||||
use rustc_session::parse::ParseSess;
|
||||
|
@ -39,7 +39,7 @@ pub enum ModError<'a> {
|
|||
ModInBlock(Option<Ident>),
|
||||
FileNotFound(Ident, PathBuf, PathBuf),
|
||||
MultipleCandidates(Ident, PathBuf, PathBuf),
|
||||
ParserError(DiagnosticBuilder<'a, ErrorReported>),
|
||||
ParserError(DiagnosticBuilder<'a, ErrorGuaranteed>),
|
||||
}
|
||||
|
||||
crate fn parse_external_mod(
|
||||
|
@ -242,7 +242,7 @@ pub fn default_submod_path<'a>(
|
|||
}
|
||||
|
||||
impl ModError<'_> {
|
||||
fn report(self, sess: &Session, span: Span) -> ErrorReported {
|
||||
fn report(self, sess: &Session, span: Span) -> ErrorGuaranteed {
|
||||
let diag = &sess.parse_sess.span_diagnostic;
|
||||
match self {
|
||||
ModError::CircularInclusion(file_paths) => {
|
||||
|
|
|
@ -6,7 +6,7 @@ use rustc_ast::ptr::P;
|
|||
use rustc_ast::token;
|
||||
use rustc_ast::tokenstream::{CanSynthesizeMissingTokens, TokenStream, TokenTree};
|
||||
use rustc_data_structures::sync::Lrc;
|
||||
use rustc_errors::ErrorReported;
|
||||
use rustc_errors::ErrorGuaranteed;
|
||||
use rustc_parse::nt_to_tokenstream;
|
||||
use rustc_parse::parser::ForceCollect;
|
||||
use rustc_span::{Span, DUMMY_SP};
|
||||
|
@ -23,7 +23,7 @@ impl base::ProcMacro for BangProcMacro {
|
|||
ecx: &'cx mut ExtCtxt<'_>,
|
||||
span: Span,
|
||||
input: TokenStream,
|
||||
) -> Result<TokenStream, ErrorReported> {
|
||||
) -> Result<TokenStream, ErrorGuaranteed> {
|
||||
let proc_macro_backtrace = ecx.ecfg.proc_macro_backtrace;
|
||||
let server = proc_macro_server::Rustc::new(ecx);
|
||||
self.client.run(&EXEC_STRATEGY, server, input, proc_macro_backtrace).map_err(|e| {
|
||||
|
@ -32,7 +32,7 @@ impl base::ProcMacro for BangProcMacro {
|
|||
err.help(&format!("message: {}", s));
|
||||
}
|
||||
err.emit();
|
||||
ErrorReported
|
||||
ErrorGuaranteed
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ impl base::AttrProcMacro for AttrProcMacro {
|
|||
span: Span,
|
||||
annotation: TokenStream,
|
||||
annotated: TokenStream,
|
||||
) -> Result<TokenStream, ErrorReported> {
|
||||
) -> Result<TokenStream, ErrorGuaranteed> {
|
||||
let proc_macro_backtrace = ecx.ecfg.proc_macro_backtrace;
|
||||
let server = proc_macro_server::Rustc::new(ecx);
|
||||
self.client
|
||||
|
@ -59,7 +59,7 @@ impl base::AttrProcMacro for AttrProcMacro {
|
|||
err.help(&format!("message: {}", s));
|
||||
}
|
||||
err.emit();
|
||||
ErrorReported
|
||||
ErrorGuaranteed
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue