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

Don't make rustc_insignificant_dtor feature gate #86446

Merged
merged 3 commits into from
Jun 29, 2021

Conversation

syvb
Copy link
Contributor

@syvb syvb commented Jun 18, 2021

This isn't a feature gate, it's an attribute that is feature gated behind the rustc_attrs attribute. Closes #85680.

@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 18, 2021
@Mark-Simulacrum
Copy link
Member

I don't think a test is necessary here, but it seems like it would be good to implement an assert that checks that all of the features listed as incomplete are also active? The runtime overhead is likely minimal; moving it to compile-time seems a little painful so I wouldn't bother if it's not trivial. We could make it part of the tidy feature checks, perhaps...

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 28, 2021
@Mark-Simulacrum
Copy link
Member

Actually, I think a good way of doing this might be to add an incomplete attribute (doesn't really matter how) to the declare_features! macro -- that could then generate the active incomplete features into the const array already present. I'm not sure how easy that'll be to pull off in the macro rules though; maybe adding another boolean field to the Feature struct is a good way to do it.

syvb added 2 commits June 28, 2021 13:14
This isn't a feature gate, it's an attribute that is feature gated
behind the `rustc_attrs` attribute. Closes rust-lang#85680.
This prevents mistakes where the feature is in the list of incomplete
features but not actually a feature by making the incompleteness a part
of the declaration.
@syvb syvb force-pushed the rustc_insignificant_dtor-ice branch from 1c38b26 to 11ebd80 Compare June 28, 2021 18:39
@syvb
Copy link
Contributor Author

syvb commented Jun 28, 2021

@Mark-Simulacrum I've updated the syntax of the macro so that it's used like this:

// normal features (unchanged)
(active, abi_ptx, "1.15.0", Some(38788), None),
// new syntax for incomplete features
(incomplete, repr128, "1.16.0", Some(56071), None),

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 28, 2021
Copy link
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me with last comment fixed

compiler/rustc_feature/src/active.rs Outdated Show resolved Hide resolved
@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 28, 2021
@Mark-Simulacrum
Copy link
Member

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Jun 29, 2021

📌 Commit 7a51cf1 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 29, 2021
@bors
Copy link
Contributor

bors commented Jun 29, 2021

⌛ Testing commit 7a51cf1 with merge fecc65a...

@bors
Copy link
Contributor

bors commented Jun 29, 2021

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing fecc65a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 29, 2021
@bors bors merged commit fecc65a into rust-lang:master Jun 29, 2021
@rustbot rustbot added this to the 1.55.0 milestone Jun 29, 2021
syvb added a commit to syvb/rustc-dev-guide that referenced this pull request Jun 29, 2021
This was changed in rust-lang/rust#86446 so that
incompleteness is included in the delcaration.
LeSeulArtichaut pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Jun 29, 2021
* Document how to mark features as incomplete

This was changed in rust-lang/rust#86446 so that
incompleteness is included in the delcaration.

* Footerify link
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE on #![feature(rustc_insignificant_dtor)]
5 participants