about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/diagnostics.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-10 18:03:53 +0000
committerbors <bors@rust-lang.org>2024-01-10 18:03:53 +0000
commita2d9d73e608f1b24eba840c4fd2d68dbe3b65e01 (patch)
tree42523e01769059455f89af632b53b841b1401d69 /compiler/rustc_parse/src/parser/diagnostics.rs
parente9271846294c4ee5bd7706df68180320c0b5ff20 (diff)
parent700a3965202f4f403956fcce744ce5ba6adf2ddb (diff)
downloadrust-a2d9d73e608f1b24eba840c4fd2d68dbe3b65e01.tar.gz
rust-a2d9d73e608f1b24eba840c4fd2d68dbe3b65e01.zip
Auto merge of #119751 - nnethercote:error-api-fixes, r=oli-obk
Diagnostic API fixes

Some improvements to diagnostic APIs: improve some naming, use shortcuts in more places, and add a couple of missing methods.

r? `@compiler-errors`
Diffstat (limited to 'compiler/rustc_parse/src/parser/diagnostics.rs')
-rw-r--r--compiler/rustc_parse/src/parser/diagnostics.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs
index a9cf26d991c..720a610fdf5 100644
--- a/compiler/rustc_parse/src/parser/diagnostics.rs
+++ b/compiler/rustc_parse/src/parser/diagnostics.rs
@@ -2847,8 +2847,8 @@ impl<'a> Parser<'a> {
         let span = label.ident.span.to(self.prev_token.span);
         self.dcx()
             .struct_span_err(span, "block label not supported here")
-            .span_label_mv(span, "not supported here")
-            .tool_only_span_suggestion_mv(
+            .with_span_label(span, "not supported here")
+            .with_tool_only_span_suggestion(
                 label.ident.span.until(self.token.span),
                 "remove this block label",
                 "",