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 #93865

Merged
merged 92 commits into from
Feb 11, 2022
Merged

Update Clippy #93865

merged 92 commits into from
Feb 11, 2022

Conversation

flip1995
Copy link
Member

jubnzv and others added 30 commits January 20, 2022 15:14
This commit changes the behavior of `single_match` lint.

After that, we won't lint non-exhaustive matches like this:

```rust
match Some(v) {
    Some(a) => println!("${:?}", a),
    None => {},
}
```

The rationale is that, because the type of `a` could be changed, so the
user can get non-exhaustive match after applying the suggested lint (see
rust-lang/rust-clippy#8282 (comment)
for context).

We also will lint `match` constructions with tuples. When we see the
tuples on the both arms, we will check them both at the same time, and
if they form exhaustive match, we could display the warning.

Closes rust-lang#8282
Update docs for `map_flatten` on `Option` case

closes rust-lang#8345

changelog: [`map_flatten`] Add docs info for `Option` case
Fix underflow in `manual_split_once` lint

Hi, a friend found clippy started crashing on a suspiciously large allocation of `u64::MAX` memory on their code.

The mostly minimized repro is:
```rust
fn _f01(title: &str) -> Option<()> {
    let _ = title[1..].splitn(2, '[').next()?;
    Some(())
}
```

The underflow happens in this case on line 57 of the patch but I've changed the other substraction to saturating as well since it could potentially cause the same issue.

I'm not sure where to put a regression test, or if it's even worth for such a thing.

Aside, has it been considered before to build clippy with overflow checks enabled?

changelog: fix ICE of underflow in `manual_split_once` lint
…steffen

Add `default_union_representation` lint

Closes rust-lang#8235

changelog: Added a new lint  [`default_union_representation`]
This will prevent unstable order when HirIds are pertubated.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 10, 2022
Comment on lines 21 to 22
// Disable this rustc lint for now, as it was also done in rustc
#![allow(rustc::potential_query_instability)]
Copy link
Member Author

Choose a reason for hiding this comment

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

ping @lcnr regarding #92584: I also allowed this lint in Clippy for now, since I don't know what to really do about this.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah 🤔 clippy shouldn't care about it afaict, that's only an issue inside of rustcs query system

once the lint is part of the beta compiler i am going to actually start using it in rustc itself

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that's also how I understood it, but wasn't 100% sure. I'll change this comment in the next sync. 👍

@Manishearth
Copy link
Member

@bors r+ rollup=never p=1

@bors
Copy link
Contributor

bors commented Feb 10, 2022

📌 Commit 78ae132 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 Feb 10, 2022
@flip1995
Copy link
Member Author

mingw-check would fail here, because I forgot a bootstrap attribute. While I checked locally if it is enough to add that, I found some more bootstrap issues. Fixed in 04c9842

This should now pass (at least it does so locally). If not, I won't be around until tomorrow to fix this.

@bors r=Manishearth,flip1995

@bors
Copy link
Contributor

bors commented Feb 10, 2022

📌 Commit 04c9842 has been approved by Manishearth,flip1995

@bors
Copy link
Contributor

bors commented Feb 10, 2022

⌛ Testing commit 04c9842 with merge 23f62bb6212f25e40c1d4f1060b1dfe17b444b9b...

@bors
Copy link
Contributor

bors commented Feb 10, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 10, 2022
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@matthiaskrgr
Copy link
Member

@bors retry Could not resolve host: ci-mirrors.rust-lang.org

@bors
Copy link
Contributor

bors commented Feb 10, 2022

@matthiaskrgr: 🔑 Insufficient privileges: not in try users

@matthiaskrgr
Copy link
Member

@bors retry Could not resolve host: ci-mirrors.rust-lang.org

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

bors commented Feb 11, 2022

⌛ Testing commit 04c9842 with merge e273fca...

@bors
Copy link
Contributor

bors commented Feb 11, 2022

☀️ Test successful - checks-actions
Approved by: Manishearth,flip1995
Pushing e273fca to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 11, 2022
@bors bors merged commit e273fca into rust-lang:master Feb 11, 2022
@rustbot rustbot added this to the 1.60.0 milestone Feb 11, 2022
@bors bors mentioned this pull request Feb 11, 2022
@flip1995 flip1995 deleted the clippyup branch February 11, 2022 09:35
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e273fca): comparison url.

Summary: This benchmark run did not return any relevant results. 1 results were found to be statistically significant but too small to be relevant.

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.