Reject escaping bound vars in the type of assoc const bindings
This commit is contained in:
parent
d26c5723e7
commit
0b2fb8db65
8 changed files with 212 additions and 20 deletions
|
@ -318,6 +318,21 @@ pub(crate) struct TyOfAssocConstBindingNote<'tcx> {
|
|||
pub ty: Ty<'tcx>,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_escaping_bound_var_in_ty_of_assoc_const_binding)]
|
||||
pub(crate) struct EscapingBoundVarInTyOfAssocConstBinding<'tcx> {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
pub assoc_const: Ident,
|
||||
pub var_name: Symbol,
|
||||
pub var_def_kind: &'static str,
|
||||
#[label(hir_analysis_var_defined_here_label)]
|
||||
pub var_defined_here_label: Span,
|
||||
#[subdiagnostic]
|
||||
pub ty_note: Option<TyOfAssocConstBindingNote<'tcx>>,
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[help(hir_analysis_parenthesized_fn_trait_expansion)]
|
||||
pub struct ParenthesizedFnTraitExpansion {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue