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

Rollup of 4 pull requests #6415

Merged
merged 21 commits into from
Dec 3, 2020
Merged

Rollup of 4 pull requests #6415

merged 21 commits into from
Dec 3, 2020

Conversation

flip1995
Copy link
Member

@flip1995 flip1995 commented Dec 3, 2020

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

changelog: rollup

suyashb95 and others added 21 commits November 28, 2020 21:21
switch Version/VersionReq usages to RustcVersion
… for crate `clippy_lints`" compiletest error
ci: always build with internal lints
group up internal lints in lib.rs
dogfood: we already pass --all-features, no need to enable internal-lints again
add `internal-lints` feature to enable clippys internal lints (off by default)

This PR moves the internal lint tests into a new subdirectory (I couldn't find a different way to compile-time-conditionally exclude them from compiletest) and only builds and tests internal lints if the `internal-lints` feature is enabled.

Fixes rust-lang#6306

changelog: put internal lints behind a feature ("internal-lints")
switch Version/VersionReq usages to RustcVersion

add `rustc-semver` to dependencies
switch `Version/VersionReq` usages to `RustcVersion`
changelog: none
Add Collapsible match lint

changelog: Add collapsible_match lint

Closes rust-lang#1252
Closes rust-lang#2521

This lint finds nested `match` or `if let` patterns that can be squashed together. It is designed to be very conservative to only find cases where merging the patterns would most likely reduce cognitive complexity.

Example:

```rust
match result {
    Ok(opt) => match opt {
        Some(x) => x,
        _ => return,
    }
    _ => return,
}
```
to
```rust
match result {
    Ok(Some(x)) => x,
    _ => return,
}
```

These criteria must be met for the lint to fire:

* The inner match has exactly 2 branches.
* Both the outer and inner match have a "wild" branch like `_ => ..`. There is a special case for `None => ..` to also be considered "wild-like".
* The contents of the wild branches are identical.
* The binding which "links" the matches is never used elsewhere.

Thanks to the hir, `if let`'s are easily included with this lint since they are desugared into equivalent `match`'es.

I think this would fit into the style category, but I would also understand changing it to pedantic.
…arth

CONTRIBUTING: update bors queue url from buildbot2.rlo to bors.rlo

changelog: CONTRIBUTING: update homu links to bors.rust-lang.org
@flip1995
Copy link
Member Author

flip1995 commented Dec 3, 2020

@bors r+ p=10

@bors
Copy link
Contributor

bors commented Dec 3, 2020

📌 Commit c9da866 has been approved by flip1995

@bors
Copy link
Contributor

bors commented Dec 3, 2020

🌲 The tree is currently closed for pull requests below priority 10, this pull request will be tested once the tree is reopened

@bors
Copy link
Contributor

bors commented Dec 3, 2020

⌛ Testing commit c9da866 with merge 249b6fe...

@flip1995 flip1995 added the rollup A PR which is a rollup label Dec 3, 2020
@bors
Copy link
Contributor

bors commented Dec 3, 2020

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing 249b6fe to master...

@bors bors merged commit 249b6fe into rust-lang:master Dec 3, 2020
@flip1995 flip1995 deleted the rollup-fz7872l branch December 3, 2020 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants