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

Tidy: ensure lang features are sorted by since #60373

Merged
merged 9 commits into from
May 3, 2019

Conversation

rasendubi
Copy link
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-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 29, 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.

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

src/tools/tidy/src/lib.rs Show resolved Hide resolved
src/tools/tidy/src/features/version.rs Outdated Show resolved Hide resolved
src/tools/tidy/src/features.rs Outdated Show resolved Hide resolved
src/tools/tidy/src/features.rs Outdated Show resolved Hide resolved
src/tools/tidy/src/features.rs Outdated Show resolved Hide resolved
src/tools/tidy/src/features.rs Outdated Show resolved Hide resolved
src/tools/tidy/src/features.rs Show resolved Hide resolved
src/tools/tidy/src/features.rs Outdated Show resolved Hide resolved
src/tools/tidy/src/features.rs Outdated Show resolved Hide resolved
src/tools/tidy/src/features/version.rs Outdated Show resolved Hide resolved
@Centril
Copy link
Contributor

Centril commented May 1, 2019

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
Copy link
Contributor Author

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

src/tools/tidy/src/features.rs Outdated Show resolved Hide resolved
src/tools/tidy/src/features/version.rs Outdated Show resolved Hide resolved
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.

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

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.

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.

src/tools/tidy/src/features.rs Outdated Show resolved Hide resolved
src/tools/tidy/src/features.rs Outdated Show resolved Hide resolved
src/tools/tidy/src/features.rs Outdated Show resolved Hide resolved
src/tools/tidy/src/features.rs Outdated Show resolved Hide resolved
src/tools/tidy/src/features.rs Outdated Show resolved Hide resolved
src/tools/tidy/src/features.rs Outdated Show resolved Hide resolved
@rasendubi
Copy link
Contributor Author

Sorry; should have noticed this before...

No problem. Fixed!

@Centril
Copy link
Contributor

Centril commented May 2, 2019

Great work; Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented May 2, 2019

📌 Commit 258b40e4345708e16af1953113bcde9480d3d91a 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 May 2, 2019
@bors
Copy link
Contributor

bors commented May 2, 2019

🔒 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.

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

Rebased on top of the master to fix the conflict.

@Centril
Copy link
Contributor

Centril commented May 2, 2019

@bors r+

@bors
Copy link
Contributor

bors commented May 2, 2019

📌 Commit 201f14b 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 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
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
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
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:master May 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 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.

5 participants