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

Update Clippy #96735

Merged
merged 199 commits into from
May 5, 2022
Merged

Update Clippy #96735

merged 199 commits into from
May 5, 2022

Conversation

flip1995
Copy link
Member

@flip1995 flip1995 commented May 5, 2022

pitaj and others added 30 commits April 1, 2022 22:36
replacing it with `&(x | y)` is actually more characters
ignore `&x | &y` in unnested_or_patterns

replacing it with `&(x | y)` is actually more characters

Fixes rust-lang#6973

changelog: [`unnested_or_patterns`] ignore `&x | &y`, nesting would result in more characters
- Create hir_crate_items query which traverses tcx.hir_crate(()).owners to return a hir::ModuleItems
- use tcx.hir_crate_items in tcx.hir().items() to return an iterator of hir::ItemId
- add par_items(impl Fn(hir::ItemId)) to traverse all items in parallel

Signed-off-by: Miguel Guarniz <[email protected]>
…rednet

Fix `unsound_collection_transmute`

fixes rust-lang#7706

changelog: Better check size and alignment requirements in `unsound_collection_transmute`
…r=nnethercote

Cached stable hash cleanups

r? `@nnethercote`

Add a sanity assertion in debug mode to check that the cached hashes are actually the ones we get if we compute the hash each time.

Add a new data structure that bundles all the hash-caching work to make it easier to re-use it for different interned data structures
split_once was stabilized in 1.52
…nce, r=xFrednet

fix comments in test for split_once

This PR fixed comments in test.

`split_once` was stabilized in 1.52, so I think the comments maybe be wrong.

ref:
https://doc.rust-lang.org/std/string/struct.String.html#method.split_once

thank you in advance.

changelog: none
add missing args

unque name not needed

more descriptive help

formatting fixes

missing quote
Allow passing `--remove` to `cargo dev setup <SUBCOMMAND>`

changelog: none

Allows passing `--remove` to `cargo dev setup <SUBCOMMAND>` as an alternative to `cargo dev remove ...`

Fixes rust-lang/rust-clippy#8663
Also fixes some incorrect suggestions for rsplitn
Remove overlap between `manual_split_once` and `needless_splitn`

changelog: Remove overlap between [`manual_split_once`] and [`needless_splitn`]. Fixes some incorrect `rsplitn` suggestions for [`manual_split_once`]

Things that can trigger `needless_splitn` no longer trigger `manual_split_once`, e.g.

```rust
s.[r]splitn(2, '=').next();
s.[r]splitn(2, '=').nth(0);
s.[r]splitn(3, '=').next_tuple();
```

Fixes some suggestions:

```rust
let s = "should not match";

s.rsplitn(2, '.').nth(1);
// old -> Some("should not match")
Some(s.rsplit_once('.').map_or(s, |x| x.0));
// new -> None
s.rsplit_once('.').map(|x| x.0);

s.rsplitn(2, '.').nth(1)?;
// old -> "should not match"
s.rsplit_once('.').map_or(s, |x| x.0);
// new -> early returns
s.rsplit_once('.')?.0;
```
bors and others added 8 commits May 4, 2022 21:16
…chenkov

Overhaul `MacArgs`

Motivation:
- Clarify some code that I found hard to understand.
- Eliminate one use of three places where `TokenKind::Interpolated` values are created.

r? `@petrochenkov`
Those lints are trait_duplication_in_bounds and
type_repetition_in_bounds. I don't think those can be fixed on the
Clippy side alone, but need changes in the compiler. So let's move them
to nursery to get the sync through and then fix them on the rustc side.

Also adds a regression test that has to be fixed before they can be
moved back to pedantic.
Rustup

r? `@ghost`

changelog: move trait_duplication_in_bounds and type_repetition_in_bounds to nursery temporarily. This could already be reverted before the release. Check the Clippy in the Rust repo beta branch when writing this changelog.
@rust-highfive
Copy link
Collaborator

Some changes occurred in src/tools/clippy.

cc @rust-lang/clippy

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 5, 2022
@Manishearth
Copy link
Member

@bors r+ p=1 rollup=never

@flip1995 flip1995 changed the title Clippyup Update Clippy May 5, 2022
@flip1995
Copy link
Member Author

flip1995 commented May 5, 2022

Bors doesn't see this PR for some reason. Let's reopen and see if that helps.

@flip1995 flip1995 closed this May 5, 2022
@flip1995 flip1995 reopened this May 5, 2022
@flip1995
Copy link
Member Author

flip1995 commented May 5, 2022

@bors ping

@flip1995
Copy link
Member Author

flip1995 commented May 5, 2022

Nope, do we have to sync the bors queue?

@flip1995
Copy link
Member Author

flip1995 commented May 5, 2022

@bors r=Manishearth

Synchronized the queue. Now bors sees this PR.

@bors
Copy link
Contributor

bors commented May 5, 2022

📌 Commit 463c760 has been approved by Manishearth

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

bors commented May 5, 2022

⌛ Testing commit 463c760 with merge 30f3860...

@bors
Copy link
Contributor

bors commented May 5, 2022

☀️ Test successful - checks-actions
Approved by: Manishearth
Pushing 30f3860 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 5, 2022
@bors bors merged commit 30f3860 into rust-lang:master May 5, 2022
@rustbot rustbot added this to the 1.62.0 milestone May 5, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (30f3860): comparison url.

Summary: This benchmark run did not return any relevant results.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

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.