1
Fork 0

Rollup merge of #108930 - Ezrashaw:better-error-for-manual-fn-impl, r=petrochenkov

feat: implement better error for manual impl of `Fn*` traits

Fixes #39259

cc `@estebank` (you gave me some advice in the linked issue, would you like to review?)
This commit is contained in:
Matthias Krüger 2023-03-10 19:59:19 +01:00 committed by GitHub
commit 76994625f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 142 additions and 51 deletions

View file

@ -129,6 +129,18 @@ pub struct AssocTypeBindingNotAllowed {
#[primary_span]
#[label]
pub span: Span,
#[subdiagnostic]
pub fn_trait_expansion: Option<ParenthesizedFnTraitExpansion>,
}
#[derive(Subdiagnostic)]
#[help(hir_analysis_parenthesized_fn_trait_expansion)]
pub struct ParenthesizedFnTraitExpansion {
#[primary_span]
pub span: Span,
pub expanded_type: String,
}
#[derive(Diagnostic)]