Skip to content

Attributes Structure #665

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

Open
philberty opened this issue Sep 10, 2021 · 2 comments
Open

Attributes Structure #665

philberty opened this issue Sep 10, 2021 · 2 comments

Comments

@philberty
Copy link
Member

I wonder is it worth checking in Rustc to see if their Attributes structure cleans this up for you in the parser so you get a structure like:

string attr_name
bool has_rhs
string get_rhs

Originally posted by @philberty in #664 (comment)

@CohenArthur
Copy link
Member

I think this part should live in its own header + source files. We can then add attribute-specific functions such as the one to handle #[path] as written by @mathstuf in #785

@mathstuf
Copy link
Contributor

mathstuf commented Nov 3, 2021

I'll note that it seems that rustc validates built-in attributes even if they aren't used. For example:

#[path = "foo"]
mod blah {
    #![path] // `rustc` errors even though it doesn't matter (the outer one "wins")
}

@philberty philberty removed this from the Imports and visibility milestone May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants