summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_hir_typeck/src/errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_hir_typeck/src/errors.rs')
-rw-r--r--compiler/rustc_hir_typeck/src/errors.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/compiler/rustc_hir_typeck/src/errors.rs b/compiler/rustc_hir_typeck/src/errors.rs
index 507272fde..5b4fd5e4a 100644
--- a/compiler/rustc_hir_typeck/src/errors.rs
+++ b/compiler/rustc_hir_typeck/src/errors.rs
@@ -172,3 +172,36 @@ impl AddToDiagnostic for TypeMismatchFruTypo {
);
}
}
+
+#[derive(Diagnostic)]
+#[diag(hir_typeck_lang_start_incorrect_number_params)]
+#[note(hir_typeck_lang_start_incorrect_number_params_note_expected_count)]
+#[note(hir_typeck_lang_start_expected_sig_note)]
+pub struct LangStartIncorrectNumberArgs {
+ #[primary_span]
+ pub params_span: Span,
+ pub found_param_count: usize,
+}
+
+#[derive(Diagnostic)]
+#[diag(hir_typeck_lang_start_incorrect_param)]
+pub struct LangStartIncorrectParam<'tcx> {
+ #[primary_span]
+ #[suggestion(style = "short", code = "{expected_ty}", applicability = "machine-applicable")]
+ pub param_span: Span,
+
+ pub param_num: usize,
+ pub expected_ty: Ty<'tcx>,
+ pub found_ty: Ty<'tcx>,
+}
+
+#[derive(Diagnostic)]
+#[diag(hir_typeck_lang_start_incorrect_ret_ty)]
+pub struct LangStartIncorrectRetTy<'tcx> {
+ #[primary_span]
+ #[suggestion(style = "short", code = "{expected_ty}", applicability = "machine-applicable")]
+ pub ret_span: Span,
+
+ pub expected_ty: Ty<'tcx>,
+ pub found_ty: Ty<'tcx>,
+}