Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistently check invalid attribute arguments #6918

Open
ironcev opened this issue Feb 11, 2025 · 0 comments
Open

Consistently check invalid attribute arguments #6918

ironcev opened this issue Feb 11, 2025 · 0 comments
Assignees
Labels
compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen compiler: parser Everything to do with the parser compiler General compiler. Should eventually become more specific as the issue is triaged team:compiler Compiler Team

Comments

@ironcev
Copy link
Member

ironcev commented Feb 11, 2025

Checks for attribute arguments are scattered thought the compiler code and, if done at all, the resulting errors and warnings are not consistent.

E.g., arguments of the #[inline] attribute are not checked at all. This compiles without any warnings or errors:

#[inline(sometimes)]
pub fn inlined_or_not() { }

E.g., the arguments of the #[cfg] attribute are checked both as warnings and as errors:

Image

E.g., the arguments of the #[storage] attribute are checked only as errors, but with different error message:

Image

@ironcev ironcev self-assigned this Feb 11, 2025
@ironcev ironcev added compiler General compiler. Should eventually become more specific as the issue is triaged compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen compiler: parser Everything to do with the parser team:compiler Compiler Team labels Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen compiler: parser Everything to do with the parser compiler General compiler. Should eventually become more specific as the issue is triaged team:compiler Compiler Team
Projects
None yet
Development

No branches or pull requests

1 participant