Remove ExtCtxt
methods that duplicate DiagCtxt
methods.
This commit is contained in:
parent
5eccfc388e
commit
d86a48278f
33 changed files with 155 additions and 180 deletions
|
@ -115,7 +115,7 @@ fn parse_assert<'a>(cx: &mut ExtCtxt<'a>, sp: Span, stream: TokenStream) -> PRes
|
|||
let mut parser = cx.new_parser_from_tts(stream);
|
||||
|
||||
if parser.token == token::Eof {
|
||||
return Err(cx.create_err(errors::AssertRequiresBoolean { span: sp }));
|
||||
return Err(cx.dcx().create_err(errors::AssertRequiresBoolean { span: sp }));
|
||||
}
|
||||
|
||||
let cond_expr = parser.parse_expr()?;
|
||||
|
@ -128,7 +128,7 @@ fn parse_assert<'a>(cx: &mut ExtCtxt<'a>, sp: Span, stream: TokenStream) -> PRes
|
|||
//
|
||||
// Emit an error about semicolon and suggest removing it.
|
||||
if parser.token == token::Semi {
|
||||
cx.emit_err(errors::AssertRequiresExpression { span: sp, token: parser.token.span });
|
||||
cx.dcx().emit_err(errors::AssertRequiresExpression { span: sp, token: parser.token.span });
|
||||
parser.bump();
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ fn parse_assert<'a>(cx: &mut ExtCtxt<'a>, sp: Span, stream: TokenStream) -> PRes
|
|||
let custom_message =
|
||||
if let token::Literal(token::Lit { kind: token::Str, .. }) = parser.token.kind {
|
||||
let comma = parser.prev_token.span.shrink_to_hi();
|
||||
cx.emit_err(errors::AssertMissingComma { span: parser.token.span, comma });
|
||||
cx.dcx().emit_err(errors::AssertMissingComma { span: parser.token.span, comma });
|
||||
|
||||
parse_custom_message(&mut parser)
|
||||
} else if parser.eat(&token::Comma) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue