diff options
Diffstat (limited to 'compiler/rustc_builtin_macros/src/assert.rs')
| -rw-r--r-- | compiler/rustc_builtin_macros/src/assert.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_builtin_macros/src/assert.rs b/compiler/rustc_builtin_macros/src/assert.rs index 7abfcc8c50c..8fa3fe5b3e6 100644 --- a/compiler/rustc_builtin_macros/src/assert.rs +++ b/compiler/rustc_builtin_macros/src/assert.rs @@ -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) { |
