diff options
| author | Eduardo Sánchez Muñoz <eduardosm-dev@e64.io> | 2023-09-17 20:13:05 +0200 | 
|---|---|---|
| committer | Eduardo Sánchez Muñoz <eduardosm-dev@e64.io> | 2023-09-19 18:15:23 +0200 | 
| commit | c599761140ed1e3824a10d556395f178617e076a (patch) | |
| tree | 56b4e6d6e8da4e6cfbdbcd77186a9a80e79b142b /compiler/rustc_infer/src/errors/mod.rs | |
| parent | 0692db1a9082380e027f354912229dfd6af37e78 (diff) | |
| download | rust-c599761140ed1e3824a10d556395f178617e076a.tar.gz rust-c599761140ed1e3824a10d556395f178617e076a.zip | |
rustc_hir_analysis: add a helper to check function the signature mismatches
This function is now used to check `#[panic_handler]`, `start` lang item, `main`, `#[start]` and intrinsic functions. The diagnosis produced are now closer to the ones produced by trait/impl method signature mismatch.
Diffstat (limited to 'compiler/rustc_infer/src/errors/mod.rs')
| -rw-r--r-- | compiler/rustc_infer/src/errors/mod.rs | 8 | 
1 files changed, 8 insertions, 0 deletions
| diff --git a/compiler/rustc_infer/src/errors/mod.rs b/compiler/rustc_infer/src/errors/mod.rs index a7e045e1e89..38910e45ecc 100644 --- a/compiler/rustc_infer/src/errors/mod.rs +++ b/compiler/rustc_infer/src/errors/mod.rs @@ -1463,6 +1463,14 @@ pub enum ObligationCauseFailureCode { #[subdiagnostic] subdiags: Vec<TypeErrorAdditionalDiags>, }, + #[diag(infer_oc_fn_lang_correct_type, code = "E0308")] + FnLangCorrectType { + #[primary_span] + span: Span, + #[subdiagnostic] + subdiags: Vec<TypeErrorAdditionalDiags>, + lang_item_name: Symbol, + }, #[diag(infer_oc_intrinsic_correct_type, code = "E0308")] IntrinsicCorrectType { #[primary_span] | 
