Port #[rustc_skip_during_method_dispatch] to the new attribute system

This commit is contained in:
Pavel Grigorenko
2025-06-18 22:27:35 +03:00
parent 42245d34d2
commit aa80a2b62c
17 changed files with 246 additions and 41 deletions

View File

@@ -496,6 +496,7 @@ pub(crate) struct NakedFunctionIncompatibleAttribute {
pub(crate) enum AttributeParseErrorReason {
ExpectedNoArgs,
ExpectedStringLiteral { byte_string: Option<Span> },
ExpectedAtLeastOneArgument,
ExpectedSingleArgument,
ExpectedList,
UnexpectedLiteral,
@@ -539,6 +540,9 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for AttributeParseError {
diag.span_label(self.span, "expected a single argument here");
diag.code(E0805);
}
AttributeParseErrorReason::ExpectedAtLeastOneArgument => {
diag.span_label(self.span, "expected at least 1 argument here");
}
AttributeParseErrorReason::ExpectedList => {
diag.span_label(self.span, "expected this to be a list");
}