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_expand/src/expand.rs | |
| parent | 5eccfc388e70d45c98b859af5c14f397ae1c206e (diff) | |
| download | rust-d86a48278f7bcd069a56870a70c6376e77bd4ee5.tar.gz rust-d86a48278f7bcd069a56870a70c6376e77bd4ee5.zip | |
Remove `ExtCtxt` methods that duplicate `DiagCtxt` methods.
Diffstat (limited to 'compiler/rustc_expand/src/expand.rs')
| -rw-r--r-- | compiler/rustc_expand/src/expand.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_expand/src/expand.rs b/compiler/rustc_expand/src/expand.rs index da727ddb208..ee1212af3f5 100644 --- a/compiler/rustc_expand/src/expand.rs +++ b/compiler/rustc_expand/src/expand.rs @@ -513,7 +513,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> { } ExpandResult::Retry(invoc) => { if force { - self.cx.span_bug( + self.cx.dcx().span_bug( invoc.span(), "expansion entered force mode but is still stuck", ); @@ -611,7 +611,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> { limit => limit * 2, }; - self.cx.emit_err(RecursionLimitReached { + self.cx.dcx().emit_err(RecursionLimitReached { span: expn_data.call_site, descr: expn_data.kind.descr(), suggested_limit, @@ -624,7 +624,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> { /// A macro's expansion does not fit in this fragment kind. /// For example, a non-type macro in a type position. fn error_wrong_fragment_kind(&mut self, kind: AstFragmentKind, mac: &ast::MacCall, span: Span) { - self.cx.emit_err(WrongFragmentKind { span, kind: kind.name(), name: &mac.path }); + self.cx.dcx().emit_err(WrongFragmentKind { span, kind: kind.name(), name: &mac.path }); self.cx.trace_macros_diag(); } @@ -702,7 +702,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> { }; let attr_item = attr.unwrap_normal_item(); if let AttrArgs::Eq(..) = attr_item.args { - self.cx.emit_err(UnsupportedKeyValue { span }); + self.cx.dcx().emit_err(UnsupportedKeyValue { span }); } let inner_tokens = attr_item.args.inner_tokens(); let Ok(tok_result) = expander.expand(self.cx, span, inner_tokens, tokens) @@ -729,7 +729,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> { AstFragmentKind::Expr | AstFragmentKind::MethodReceiverExpr ) && items.is_empty() { - self.cx.emit_err(RemoveExprNotSupported { span }); + self.cx.dcx().emit_err(RemoveExprNotSupported { span }); fragment_kind.dummy(span) } else { fragment_kind.expect_from_annotatables(items) @@ -1050,7 +1050,7 @@ trait InvocationCollectorNode: HasAttrs + HasNodeId + Sized { _pos: usize, span: Span, ) { - collector.cx.emit_err(RemoveNodeNotSupported { span, descr: Self::descr() }); + collector.cx.dcx().emit_err(RemoveNodeNotSupported { span, descr: Self::descr() }); } /// All of the names (items) declared by this node. |
