Added checks for attribute in type case

This commit is contained in:
Kivooeo
2025-07-20 02:25:36 +05:00
parent f63685ddf3
commit d09cf616f7
14 changed files with 395 additions and 23 deletions

View File

@@ -1489,6 +1489,34 @@ pub(crate) struct AttributeOnParamType {
pub span: Span,
}
#[derive(Diagnostic)]
#[diag(parse_attribute_on_type)]
pub(crate) struct AttributeOnType {
#[primary_span]
#[label]
pub span: Span,
#[suggestion(code = "", applicability = "machine-applicable", style = "tool-only")]
pub fix_span: Span,
}
#[derive(Diagnostic)]
#[diag(parse_attribute_on_generic_arg)]
pub(crate) struct AttributeOnGenericArg {
#[primary_span]
#[label]
pub span: Span,
#[suggestion(code = "", applicability = "machine-applicable", style = "tool-only")]
pub fix_span: Span,
}
#[derive(Diagnostic)]
#[diag(parse_attribute_on_empty_type)]
pub(crate) struct AttributeOnEmptyType {
#[primary_span]
#[label]
pub span: Span,
}
#[derive(Diagnostic)]
#[diag(parse_pattern_method_param_without_body, code = E0642)]
pub(crate) struct PatternMethodParamWithoutBody {