Reject early-bound params in the type of assoc const bindings
This commit is contained in:
parent
3b85d2c7fc
commit
d26c5723e7
5 changed files with 270 additions and 10 deletions
|
@ -295,6 +295,29 @@ pub struct AssocTypeBindingNotAllowed {
|
|||
pub fn_trait_expansion: Option<ParenthesizedFnTraitExpansion>,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_param_in_ty_of_assoc_const_binding)]
|
||||
pub(crate) struct ParamInTyOfAssocConstBinding<'tcx> {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
pub assoc_const: Ident,
|
||||
pub param_name: Symbol,
|
||||
pub param_def_kind: &'static str,
|
||||
pub param_category: &'static str,
|
||||
#[label(hir_analysis_param_defined_here_label)]
|
||||
pub param_defined_here_label: Option<Span>,
|
||||
#[subdiagnostic]
|
||||
pub ty_note: Option<TyOfAssocConstBindingNote<'tcx>>,
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic, Clone, Copy)]
|
||||
#[note(hir_analysis_ty_of_assoc_const_binding_note)]
|
||||
pub(crate) struct TyOfAssocConstBindingNote<'tcx> {
|
||||
pub assoc_const: Ident,
|
||||
pub ty: Ty<'tcx>,
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[help(hir_analysis_parenthesized_fn_trait_expansion)]
|
||||
pub struct ParenthesizedFnTraitExpansion {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue