Feature gating *declarations* => new crate rustc_feature#66895
Merged
bors merged 14 commits intorust-lang:masterfrom Dec 1, 2019
Merged
Feature gating *declarations* => new crate rustc_feature#66895bors merged 14 commits intorust-lang:masterfrom
rustc_feature#66895bors merged 14 commits intorust-lang:masterfrom
Conversation
oli-obk
reviewed
Nov 30, 2019
| ]; | ||
|
|
||
| #[derive(Debug)] | ||
| pub struct GatedCfg { |
Contributor
There was a problem hiding this comment.
why move away from a struct with field names to a tuple?
Contributor
Author
There was a problem hiding this comment.
If you look above, the constant contains the tuples already -- I'm introducing a type alias for that. The struct GatedCfg with span and index was actively harmful; imo it became clearly cleaner using .find(...) instead. Ostensibly we could store the constant as a list of structs instead, but it doesn't seem worth it given the number of times the type is referenced and used?
38256d8 to
ded177a
Compare
Contributor
|
@bors r+ |
Collaborator
|
📌 Commit ded177a has been approved by |
Collaborator
|
🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened |
Centril
added a commit
to Centril/rust
that referenced
this pull request
Nov 30, 2019
Feature gating *declarations* => new crate `rustc_feature` This PR moves the data-oriented parts of feature gating into its own crate, `rustc_feature`. The parts consist of some data types as well as `accepted`, `active`, `removed`, and `builtin_attrs`. Feature gate checking itself remains in `syntax::feature_gate::check`. The parts which define how to emit feature gate errors could probably be moved to `rustc_errors` or to the new `rustc_session` crate introduced in rust-lang#66878. The visitor itself could probably be moved as a pass in `rustc_passes` depending on how the dependency edges work out. The PR also contains some drive-by cleanup of feature gate checking. As such, the PR probably best read commit-by-commit. r? @oli-obk cc @petrochenkov cc @Mark-Simulacrum
bors
added a commit
that referenced
this pull request
Dec 1, 2019
Rollup of 9 pull requests Successful merges: - #66612 (Initial implementation of or-pattern usefulness checking) - #66705 (Atomic as_mut_ptr) - #66759 (impl TrustedLen for vec::Drain) - #66858 (Use LLVMAddAnalysisPasses instead of Rust's wrapper) - #66870 (SimplifyArmIdentity only for locals with the same type) - #66883 (rustc_typeck: gate AnonConst's generics on feature(const_generics).) - #66889 (Make python-generated source files compatible with rustfmt) - #66894 (Remove unneeded prelude imports in libcore tests) - #66895 (Feature gating *declarations* => new crate `rustc_feature`) Failed merges: - #66905 (rustc_plugin: Remove some remaining plugin features) r? @ghost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR moves the data-oriented parts of feature gating into its own crate,
rustc_feature.The parts consist of some data types as well as
accepted,active,removed, andbuiltin_attrs.Feature gate checking itself remains in
syntax::feature_gate::check. The parts which define how to emit feature gate errors could probably be moved torustc_errorsor to the newrustc_sessioncrate introduced in #66878. The visitor itself could probably be moved as a pass inrustc_passesdepending on how the dependency edges work out.The PR also contains some drive-by cleanup of feature gate checking. As such, the PR probably best read commit-by-commit.
r? @oli-obk
cc @petrochenkov
cc @Mark-Simulacrum