]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_parse/src/errors.rs
Rollup merge of #104137 - StackDoubleFlow:err-lsc-unsupported, r=bjorn3
[rust.git] / compiler / rustc_parse / src / errors.rs
index d59982f7063f33e5756cdf62cfb60eecc0b7e576..2b17cea97949a2cdfd1cecfcd17a56af5387dea6 100644 (file)
@@ -1205,6 +1205,14 @@ pub(crate) struct SelfParamNotFirst {
     pub span: Span,
 }
 
+#[derive(Diagnostic)]
+#[diag(parser_invalid_identifier_with_leading_number)]
+pub(crate) struct InvalidIdentiferStartsWithNumber {
+    #[primary_span]
+    #[label]
+    pub span: Span,
+}
+
 #[derive(Diagnostic)]
 #[diag(parser_const_generic_without_braces)]
 pub(crate) struct ConstGenericWithoutBraces {
@@ -1280,3 +1288,24 @@ pub(crate) struct DoubleColonInBound {
     #[suggestion(code = ": ", applicability = "machine-applicable")]
     pub between: Span,
 }
+
+#[derive(Diagnostic)]
+#[diag(parser_fn_ptr_with_generics)]
+pub(crate) struct FnPtrWithGenerics {
+    #[primary_span]
+    pub span: Span,
+    #[subdiagnostic]
+    pub sugg: Option<FnPtrWithGenericsSugg>,
+}
+
+#[derive(Subdiagnostic)]
+#[multipart_suggestion(suggestion, applicability = "maybe-incorrect")]
+pub(crate) struct FnPtrWithGenericsSugg {
+    #[suggestion_part(code = "{snippet}")]
+    pub left: Span,
+    pub snippet: String,
+    #[suggestion_part(code = "")]
+    pub right: Span,
+    pub arity: usize,
+    pub for_param_list_exists: bool,
+}