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_gate.rs into modules & cleanup #63824

Merged
merged 13 commits into from
Aug 24, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Aug 22, 2019

Split src/libsyntax/feature_gate.rs into src/libsyntax/feature_gate/ with files:

  • accepted.rs (accepted feature gates)
  • removed.rs (...)
  • active.rs (...)
  • builtin_attrs.rs (definition of builtin attributes and their gates as well as gating cfg flags)
  • check.rs (post expansion checking of feature gates)
  • mod.rs (just reexports)

Additionally, tidy.rs is adjusted to respect the new scheme.

Also, builtin_attrs.rs sees some cleanup, organization, and DSL-ification to reduce repetition.

This is probably best read commit-by-commit I think.

r? @oli-obk

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 22, 2019
@Centril Centril changed the title Refactor feature_gate.rs into a module & cleanup Refactor feature_gate.rs into modules & cleanup Aug 22, 2019
Copy link
Contributor

@oli-obk oli-obk 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 question resolved

};
}

// If you change this, please modify `src/doc/unstable-book` as well.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this comment relevant? Do we have any file paths to adjust?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The comment is moved over to active.rs which seemed like the most appropriate place to have it. The latter bits are still relevant but I don't know how much the unstable book still is but that seems like a larger question which is preferably resolved in a more dedicated place. The file paths are still right however.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Filed as an issue in #63840.

@Centril
Copy link
Contributor Author

Centril commented Aug 24, 2019

@bors r=oli-obk p=5 rollup=never (bitrotty / rebasing this will be painful...)

@bors
Copy link
Contributor

bors commented Aug 24, 2019

📌 Commit 3e061f7 has been approved by oli-obk

@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
@bors
Copy link
Contributor

bors commented Aug 24, 2019

⌛ Testing commit 3e061f7 with merge c2f3174...

bors added a commit that referenced this pull request Aug 24, 2019
Refactor `feature_gate.rs` into modules & cleanup

Split `src/libsyntax/feature_gate.rs` into `src/libsyntax/feature_gate/` with files:
- `accepted.rs` (accepted feature gates)
- `removed.rs` (...)
- `active.rs` (...)
- `builtin_attrs.rs` (definition of builtin attributes and their gates as well as gating `cfg` flags)
- `check.rs` (post expansion checking of feature gates)
- `mod.rs` (just reexports)

Additionally, `tidy.rs` is adjusted to respect the new scheme.

Also, `builtin_attrs.rs` sees some cleanup, organization, and DSL-ification to reduce repetition.

This is probably best read commit-by-commit I think.

r? @oli-obk
@bors
Copy link
Contributor

bors commented Aug 24, 2019

☀️ Test successful - checks-azure
Approved by: oli-obk
Pushing c2f3174 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 24, 2019
@bors bors merged commit 3e061f7 into rust-lang:master Aug 24, 2019
@Centril Centril deleted the split-feature_gate branch August 24, 2019 10:36
Centril pushed a commit to Centril/rust that referenced this pull request Aug 24, 2019
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.
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
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
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.

4 participants