1
Fork 0

Reject escaping bound vars in the type of assoc const bindings

This commit is contained in:
León Orell Valerian Liehr 2024-01-10 02:11:25 +01:00
parent d26c5723e7
commit 0b2fb8db65
No known key found for this signature in database
GPG key ID: D17A07215F68E713
8 changed files with 212 additions and 20 deletions

View file

@ -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 {