rustc_errors: let DiagnosticBuilder::emit
return a "guarantee of emission".
This commit is contained in:
parent
0b9d70cf6d
commit
b7e95dee65
83 changed files with 842 additions and 471 deletions
|
@ -18,7 +18,7 @@ use rustc_ast::{
|
|||
};
|
||||
use rustc_ast::{Block, BlockCheckMode, Expr, ExprKind, Local, Stmt};
|
||||
use rustc_ast::{StmtKind, DUMMY_NODE_ID};
|
||||
use rustc_errors::{Applicability, DiagnosticBuilder, PResult};
|
||||
use rustc_errors::{Applicability, DiagnosticBuilder, ErrorReported, PResult};
|
||||
use rustc_span::source_map::{BytePos, Span};
|
||||
use rustc_span::symbol::{kw, sym};
|
||||
|
||||
|
@ -414,7 +414,10 @@ impl<'a> Parser<'a> {
|
|||
Ok(block)
|
||||
}
|
||||
|
||||
fn error_block_no_opening_brace_msg(&mut self, msg: &str) -> DiagnosticBuilder<'a> {
|
||||
fn error_block_no_opening_brace_msg(
|
||||
&mut self,
|
||||
msg: &str,
|
||||
) -> DiagnosticBuilder<'a, ErrorReported> {
|
||||
let sp = self.token.span;
|
||||
let mut e = self.struct_span_err(sp, msg);
|
||||
let do_not_suggest_help = self.token.is_keyword(kw::In) || self.token == token::Colon;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue