-
Notifications
You must be signed in to change notification settings - Fork 69
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
Attribute handling reworks #796
Comments
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed. Concerns or objections to the proposal should be discussed on Zulip and formally registered here by adding a comment with the following syntax:
Concerns can be lifted with:
See documentation at https://forge.rust-lang.org cc @rust-lang/compiler @rust-lang/compiler-contributors |
@rustbot second |
@rustbot label -final-comment-period +major-change-accepted |
…bk,petrochenkov Hir attributes This PR needs some explanation, it's somewhat large. - This is step one as described in rust-lang/compiler-team#796. I've added a new `hir::Attribute` which is a lowered version of `ast::Attribute`. Right now, this has few concrete effects, however every place that after this PR parses a `hir::Attribute` should later get a pre-parsed attribute as described in rust-lang/compiler-team#796 and transitively rust-lang#131229. - an extension trait `AttributeExt` is added, which is implemented for both `ast::Attribute` and `hir::Atribute`. This makes `hir::Attributes` mostly compatible with code that used to parse `ast::Attribute`. All its methods are also added as inherent methods to avoid having to import the trait everywhere in the compiler. - Incremental can not not hash `ast::Attribute` at all.
…bk,petrochenkov Hir attributes This PR needs some explanation, it's somewhat large. - This is step one as described in rust-lang/compiler-team#796. I've added a new `hir::Attribute` which is a lowered version of `ast::Attribute`. Right now, this has few concrete effects, however every place that after this PR parses a `hir::Attribute` should later get a pre-parsed attribute as described in rust-lang/compiler-team#796 and transitively rust-lang#131229. - an extension trait `AttributeExt` is added, which is implemented for both `ast::Attribute` and `hir::Atribute`. This makes `hir::Attributes` mostly compatible with code that used to parse `ast::Attribute`. All its methods are also added as inherent methods to avoid having to import the trait everywhere in the compiler. - Incremental can not not hash `ast::Attribute` at all.
Proposal
Attributes are only partially lowered, and parsed in no less than 60 different places all around the compiler. I filed an issue earlier on rust-lang/rust but on the recomendation of @BoxyUwU and @WaffleLapkin I'm filing this as an MCP. Usually a proposal goes here, but I think my original issue already rougly covers that. I will, below, discuss steps in which we can implement this change.
ast::Attribute
andhir::Attribute
Hir attributes rust#131808hir::Attribute
with one variant that represents "old style" attributes and contains the current structure, and where more variants can be added that are pre-parsedrustc_attr
to be the place where attributes are parsed and checked, making this a central place for this.Mentors or Reviewers
I'll certainly talk a lot to @WaffleLapkin and @m-ou-se about this as I work with them daily. Apart from that, maybe more people are interested? Possibly @petrochenkov should second this too.
Process
The main points of the Major Change Process are as follows:
@rustbot second
.-C flag
, then full team check-off is required.@rfcbot fcp merge
on either the MCP or the PR.You can read more about Major Change Proposals on forge.
Comments
There was already a zulip stream for this: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Attribute.20handling.20reworks
Let me also ping @jieyouxu and @bjorn3 here as they commented on the orginal proposal.
The text was updated successfully, but these errors were encountered: