Skip to content

Tidy: ensure lang features are sorted by since - #60373

Merged
bors merged 9 commits into
rust-lang:masterfrom
rasendubi:lang-features-sort-since
May 3, 2019
Merged

Tidy: ensure lang features are sorted by since#60373
bors merged 9 commits into
rust-lang:masterfrom
rasendubi:lang-features-sort-since

Conversation

@rasendubi

Copy link
Copy Markdown
Contributor

This is the tidy side of #60361.

What is left is actually splitting features into groups and sorting by since.

This PR also likely to produce a small (a couple of lines) merge conflict with #60362.

r? @Centril

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 29, 2019
@rasendubi
rasendubiforce-pushed the lang-features-sort-since branch from f6e7d31 to a4ff1d9CompareApril 29, 2019 18:02

@CentrilCentril left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks pretty good in general; some nits... :)

Comment threadsrc/tools/tidy/src/lib.rs Outdated
Comment threadsrc/tools/tidy/src/features/version.rs Outdated
Comment threadsrc/tools/tidy/src/features.rs Outdated
Comment threadsrc/tools/tidy/src/features.rs Outdated
Comment threadsrc/tools/tidy/src/features.rs Outdated
Comment threadsrc/tools/tidy/src/features.rs Outdated
Comment threadsrc/tools/tidy/src/features.rs Outdated
Comment threadsrc/tools/tidy/src/features.rs Outdated
Comment threadsrc/tools/tidy/src/features.rs Outdated
Comment threadsrc/tools/tidy/src/features/version.rs Outdated
@Centril

Centril commented May 1, 2019

Copy link
Copy Markdown
Contributor

What is left is actually splitting features into groups and sorting by since.

If you look at the feature_gate.rs file now you will see:

// -------------------------------------------------------------------------
// Internal feature gates.
// -------------------------------------------------------------------------

which is then followed by:

// -------------------------------------------------------------------------
// Actual feature gates (target features).
// -------------------------------------------------------------------------

and:

// -------------------------------------------------------------------------
// Actual feature gates.
// -------------------------------------------------------------------------

For the time being, you should be able to use these 3 groups to test the new tidy logic out, for example:

// -------------------------------------------------------------------------// feature-group-start: internal feature gates// -------------------------------------------------------------------------
$the_features
// -------------------------------------------------------------------------// feature-group-end: internal feature gates// -------------------------------------------------------------------------

@rasendubi
rasendubiforce-pushed the lang-features-sort-since branch from c80c5b3 to b2a8617CompareMay 1, 2019 19:43
@rasendubi

Copy link
Copy Markdown
ContributorAuthor

Rebased on master, grouped and sorted feature gates. Ready for review!

Comment threadsrc/tools/tidy/src/features.rs Outdated
Comment threadsrc/tools/tidy/src/features/version.rs Outdated
@rasendubi
rasendubiforce-pushed the lang-features-sort-since branch from c1b18b7 to 7646763CompareMay 1, 2019 21:54

@CentrilCentril left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks great! Let's wait for travis to go green and let's merge :)

Comment threadsrc/tools/tidy/src/features.rs Outdated

@CentrilCentril left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry; should have noticed this before... Right now you are not using next_feature_group as anything but a bool so Some(group.to_owned()) is not useful here. Let's just switch to a bool.

Comment threadsrc/tools/tidy/src/features.rs Outdated
Comment threadsrc/tools/tidy/src/features.rs Outdated
Comment threadsrc/tools/tidy/src/features.rs Outdated
Comment threadsrc/tools/tidy/src/features.rs Outdated
Comment threadsrc/tools/tidy/src/features.rs Outdated
Comment threadsrc/tools/tidy/src/features.rs Outdated
@rasendubi

Copy link
Copy Markdown
ContributorAuthor

Sorry; should have noticed this before...

No problem. Fixed!

@Centril

Copy link
Copy Markdown
Contributor

Great work; Thanks!

@bors r+

@bors

bors commented May 2, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit 258b40e4345708e16af1953113bcde9480d3d91a has been approved by Centril

@borsbors 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 May 2, 2019
@bors

bors commented May 2, 2019

Copy link
Copy Markdown
Collaborator

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout lang-features-sort-since(switch to your branch)
  2. git fetch upstream master(retrieve the latest master)
  3. git rebase upstream/master -p(rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self lang-features-sort-since --force-with-lease(update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
warning: Cannot merge binary files: Cargo.lock (HEAD vs. heads/homu-tmp)
Auto-merging Cargo.lock
CONFLICT (content): Merge conflict in Cargo.lock
Automatic merge failed; fix conflicts and then commit the result.

@borsbors 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 May 2, 2019
`find_attr_val(&line, "since")` returns `Some(", issue = ")` when
`line` is set to the following line:
```
[unstable(feature = "checked_duration_since", issue = "58402")]
```
Make `find_attr_val` use regex that is a little bit more
precise (requires `=` after key name).
It still does not handle all cases (e.g., extra leading chars in key
name, or escaped quotes in value), but is good enough for now.
@rasendubi
rasendubiforce-pushed the lang-features-sort-since branch from 258b40e to 201f14bCompareMay 2, 2019 13:39
@rasendubi

Copy link
Copy Markdown
ContributorAuthor

Rebased on top of the master to fix the conflict.

@Centril

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented May 2, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit 201f14b has been approved by Centril

@borsbors 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 May 2, 2019
kennytm added a commit to kennytm/rust that referenced this pull request May 2, 2019
… r=Centril
Tidy: ensure lang features are sorted by since
This is the tidy side of rust-lang#60361.
What is left is actually splitting features into groups and sorting by since.
This PR also likely to produce a small (a couple of lines) merge conflict with rust-lang#60362.
r? @Centril
@kennytmkennytm mentioned this pull request May 2, 2019
Centril added a commit to Centril/rust that referenced this pull request May 2, 2019
… r=Centril
Tidy: ensure lang features are sorted by since
This is the tidy side of rust-lang#60361.
What is left is actually splitting features into groups and sorting by since.
This PR also likely to produce a small (a couple of lines) merge conflict with rust-lang#60362.
r? @Centril
@CentrilCentril mentioned this pull request May 2, 2019
Centril added a commit to Centril/rust that referenced this pull request May 3, 2019
… r=Centril
Tidy: ensure lang features are sorted by since
This is the tidy side of rust-lang#60361.
What is left is actually splitting features into groups and sorting by since.
This PR also likely to produce a small (a couple of lines) merge conflict with rust-lang#60362.
r? @Centril
@CentrilCentril mentioned this pull request May 3, 2019
bors added a commit that referenced this pull request May 3, 2019
Rollup of 12 pull requests
Successful merges:
- #59928 (Make deprecation lint `ambiguous_associated_items` deny-by-default)
- #60220 (report fatal errors during doctest parsing)
- #60373 (Tidy: ensure lang features are sorted by since)
- #60388 (Disallow non-explicit elided lifetimes in async fn)
- #60393 ( Do not suggest incorrect syntax on pattern type error due to borrow)
- #60401 (Rename `RUST_LOG` to `RUSTC_LOG`)
- #60409 (Require a trait in the bounds of existential types)
- #60455 (Resolve match arm ty when arms diverge)
- #60457 (Const prop refactoring)
- #60467 (Avoid repeated interning of static strings.)
- #60478 (minor compiler doc tweaks)
- #60501 (Propagate mutability from arguments to local bindings in async fn)
Failed merges:
r? @ghost
@bors
bors merged commit 201f14b into rust-lang:masterMay 3, 2019
bors added a commit that referenced this pull request May 7, 2019
Enforce sorting of accepted and removed features
Fixes#60361 with mechanism introduced in #60373.
r? @oli-obk
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: 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.

5 participants

@rasendubi@Centril@bors@fbstj@rust-highfive