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

Refactor feature gates #63855

Merged
merged 4 commits into from
Aug 27, 2019
Merged

Conversation

killercup
Copy link
Member

After #63824, this goes a few steps further by

  • parsing doc comments in the macros to extract descriptions for feature gates, and
  • introducing a common Feature type to replace the tuples used previously to improve readability.

The descriptions are not yet used, but I felt like this PR is a useful enough refactoring on its own.

r? @Centril

Feature gate definitions were split into multiple files in rust-lang#63824 but
tidy kept reporting the hard-coded path. Now, it shows the full path
to the correct file.
This is just in preparation for future usage of these texts.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 24, 2019
Copy link
Contributor

@Centril Centril left a comment

Choose a reason for hiding this comment

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

Thanks! r=me with comments below addressed. :)

src/libsyntax/feature_gate/check.rs Outdated Show resolved Hide resolved
src/libsyntax/feature_gate/check.rs Outdated Show resolved Hide resolved
src/libsyntax/feature_gate/check.rs Outdated Show resolved Hide resolved
src/libsyntax/feature_gate/check.rs Outdated Show resolved Hide resolved
src/libsyntax/feature_gate/check.rs Outdated Show resolved Hide resolved
src/libsyntax/feature_gate/check.rs Outdated Show resolved Hide resolved
@killercup
Copy link
Member Author

Thanks for the review, @Centril! I've changed most of the loops you mentioned, so it'd be good to have a second look before I blindly r+ this :)

@Centril
Copy link
Contributor

Centril commented Aug 24, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Aug 24, 2019

📌 Commit 6ffc834 has been approved by Centril

@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-review Status: Awaiting review from the assignee but also interested parties. labels Aug 24, 2019
Centril added a commit to Centril/rust that referenced this pull request Aug 24, 2019
…=Centril

Refactor feature gates

After rust-lang#63824, this goes a few steps further by

- parsing doc comments in the macros to extract descriptions for feature gates, and
- introducing a common `Feature` type to replace the tuples used previously to improve readability.

The descriptions are not yet used, but I felt like this PR is a useful enough refactoring on its own.

r? @Centril
@rust-highfive

This comment has been minimized.

@Centril
Copy link
Contributor

Centril commented Aug 24, 2019

That's odd; I don't see anything that would cause this... @bors r-

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 24, 2019
This replaces the ad-hoc tuples used in the different feature gate files
and unifies their content into a common type, leading to more readable
matches and other good stuff that comes from having named fields. It
also contains the description of each feature as extracted from the doc
comment.
@killercup
Copy link
Member Author

Let's try this again! Tests pass locally but I'll wait for CI before sending it off to bors.

@rust-highfive

This comment has been minimized.

Tries to clarify the filtering of active features and make the code more
expressive.
@killercup
Copy link
Member Author

@bors r=Centril rollup

@bors
Copy link
Contributor

bors commented Aug 25, 2019

📌 Commit 94e8ff4 has been approved by Centril

@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 Aug 25, 2019
Centril added a commit to Centril/rust that referenced this pull request Aug 26, 2019
…=Centril

Refactor feature gates

After rust-lang#63824, this goes a few steps further by

- parsing doc comments in the macros to extract descriptions for feature gates, and
- introducing a common `Feature` type to replace the tuples used previously to improve readability.

The descriptions are not yet used, but I felt like this PR is a useful enough refactoring on its own.

r? @Centril
bors added a commit that referenced this pull request Aug 27, 2019
Rollup of 6 pull requests

Successful merges:

 - #63317 (Do not complain about unused code when used in `impl` `Self` type)
 - #63693 (Fully implement or-pattern parsing)
 - #63836 (VxWorks does not provide a way to set the task name except at creation time)
 - #63845 (Removed a confusing FnOnce example)
 - #63855 (Refactor feature gates)
 - #63921 (add link to FileCheck docs)

Failed merges:

r? @ghost
@bors bors merged commit 94e8ff4 into rust-lang:master Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants