diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-18 20:54:03 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-24 07:24:52 +1100 |
| commit | d86a48278f7bcd069a56870a70c6376e77bd4ee5 (patch) | |
| tree | 7b653abdf0eda9cd3568a96299fbfe28a39ee259 /compiler/rustc_builtin_macros/src/assert.rs | |
| parent | 5eccfc388e70d45c98b859af5c14f397ae1c206e (diff) | |
| download | rust-d86a48278f7bcd069a56870a70c6376e77bd4ee5.tar.gz rust-d86a48278f7bcd069a56870a70c6376e77bd4ee5.zip | |
Remove `ExtCtxt` methods that duplicate `DiagCtxt` methods.
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) { |
