]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir_typeck/src/errors.rs
Rollup merge of #104965 - zacklukem:p-option-as_ref-docs, r=scottmcm
[rust.git] / compiler / rustc_hir_typeck / src / errors.rs
index 507272fdec5d71b334624b04d287820c7e19ecae..5b4fd5e4a5283833b8eaa051df969a021e165161 100644 (file)
@@ -172,3 +172,36 @@ fn add_to_diagnostic_with<F>(self, diag: &mut Diagnostic, _: F)
         );
     }
 }
+
+#[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>,
+}