Add create_err
and emit_err
to ExtCtxt
This commit is contained in:
parent
72fd41a8b4
commit
761c846a07
1 changed files with 12 additions and 1 deletions
|
@ -14,7 +14,7 @@ use rustc_errors::{Applicability, DiagnosticBuilder, ErrorGuaranteed, MultiSpan,
|
|||
use rustc_lint_defs::builtin::PROC_MACRO_BACK_COMPAT;
|
||||
use rustc_lint_defs::BuiltinLintDiagnostics;
|
||||
use rustc_parse::{self, parser, MACRO_ARGUMENTS};
|
||||
use rustc_session::{parse::ParseSess, Limit, Session};
|
||||
use rustc_session::{parse::ParseSess, Limit, Session, SessionDiagnostic};
|
||||
use rustc_span::def_id::{CrateNum, DefId, LocalDefId};
|
||||
use rustc_span::edition::Edition;
|
||||
use rustc_span::hygiene::{AstPass, ExpnData, ExpnKind, LocalExpnId};
|
||||
|
@ -1085,6 +1085,17 @@ impl<'a> ExtCtxt<'a> {
|
|||
self.sess.parse_sess.span_diagnostic.struct_span_err(sp, msg)
|
||||
}
|
||||
|
||||
pub fn create_err(
|
||||
&self,
|
||||
err: impl SessionDiagnostic<'a>,
|
||||
) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
|
||||
self.sess.create_err(err)
|
||||
}
|
||||
|
||||
pub fn emit_err(&self, err: impl SessionDiagnostic<'a>) -> ErrorGuaranteed {
|
||||
self.sess.emit_err(err)
|
||||
}
|
||||
|
||||
/// Emit `msg` attached to `sp`, without immediately stopping
|
||||
/// compilation.
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue