1
Fork 0

Deny capturing late-bound non-lifetime param in anon const

This commit is contained in:
Michael Goulet 2023-02-28 05:59:54 +00:00
parent b583ede652
commit cbf4d4e3a5
5 changed files with 121 additions and 5 deletions

View file

@ -381,3 +381,21 @@ pub(crate) struct VariadicFunctionCompatibleConvention<'a> {
pub span: Span,
pub conventions: &'a str,
}
#[derive(Diagnostic)]
pub(crate) enum CannotCaptureLateBoundInAnonConst {
#[diag(hir_analysis_cannot_capture_late_bound_ty_in_anon_const)]
Type {
#[primary_span]
use_span: Span,
#[label]
def_span: Span,
},
#[diag(hir_analysis_cannot_capture_late_bound_const_in_anon_const)]
Const {
#[primary_span]
use_span: Span,
#[label]
def_span: Span,
},
}