summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_parse/src/errors.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /compiler/rustc_parse/src/errors.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
-rw-r--r--compiler/rustc_parse/src/errors.rs18
1 files changed, 15 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs
index e0b1e3678..7c75e440a 100644
--- a/compiler/rustc_parse/src/errors.rs
+++ b/compiler/rustc_parse/src/errors.rs
@@ -10,7 +10,7 @@ use rustc_span::symbol::Ident;
use rustc_span::{Span, Symbol};
use crate::fluent_generated as fluent;
-use crate::parser::TokenDescription;
+use crate::parser::{ForbiddenLetReason, TokenDescription};
#[derive(Diagnostic)]
#[diag(parse_maybe_report_ambiguous_plus)]
@@ -59,9 +59,18 @@ pub(crate) enum BadTypePlusSub {
#[diag(parse_maybe_recover_from_bad_qpath_stage_2)]
pub(crate) struct BadQPathStage2 {
#[primary_span]
- #[suggestion(code = "", applicability = "maybe-incorrect")]
pub span: Span,
- pub ty: String,
+ #[subdiagnostic]
+ pub wrap: WrapType,
+}
+
+#[derive(Subdiagnostic)]
+#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
+pub(crate) struct WrapType {
+ #[suggestion_part(code = "<")]
+ pub lo: Span,
+ #[suggestion_part(code = ">")]
+ pub hi: Span,
}
#[derive(Diagnostic)]
@@ -392,9 +401,12 @@ pub(crate) struct IfExpressionMissingCondition {
#[derive(Diagnostic)]
#[diag(parse_expected_expression_found_let)]
+#[note]
pub(crate) struct ExpectedExpressionFoundLet {
#[primary_span]
pub span: Span,
+ #[subdiagnostic]
+ pub reason: ForbiddenLetReason,
}
#[derive(Diagnostic)]