about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src/errors.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-11-26 17:53:00 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-12-09 21:55:12 +0000
commit550bcae8aa7859abace52c20b8b9149ae6cb37f1 (patch)
tree0ac51fba8bb64e7dcfedc78876c01df1a8f574e7 /compiler/rustc_ast_lowering/src/errors.rs
parent9ac95c10c09faf50cc22eb97b6e1c59d64053c28 (diff)
downloadrust-550bcae8aa7859abace52c20b8b9149ae6cb37f1.tar.gz
rust-550bcae8aa7859abace52c20b8b9149ae6cb37f1.zip
Detect `struct S(ty = val);`
Emit a specific error for unsupported default field value syntax in tuple structs.
Diffstat (limited to 'compiler/rustc_ast_lowering/src/errors.rs')
-rw-r--r--compiler/rustc_ast_lowering/src/errors.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_ast_lowering/src/errors.rs b/compiler/rustc_ast_lowering/src/errors.rs
index 665da14e861..2564d4e2772 100644
--- a/compiler/rustc_ast_lowering/src/errors.rs
+++ b/compiler/rustc_ast_lowering/src/errors.rs
@@ -38,6 +38,14 @@ pub(crate) struct InvalidAbi {
     pub suggestion: Option<InvalidAbiSuggestion>,
 }
 
+#[derive(Diagnostic)]
+#[diag(ast_lowering_default_field_in_tuple)]
+pub(crate) struct TupleStructWithDefault {
+    #[primary_span]
+    #[label]
+    pub span: Span,
+}
+
 pub(crate) struct InvalidAbiReason(pub &'static str);
 
 impl Subdiagnostic for InvalidAbiReason {