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

Merged
merged 23 commits into from
Jul 19, 2021
Merged

Update Clippy #87271

merged 23 commits into from
Jul 19, 2021

Conversation

flip1995
Copy link
Member

This is an out-of-cycle Clippy update, to fix 3 ICEs before the release (This should be merged before beta is branched):

rust-lang/rust-clippy#7470
rust-lang/rust-clippy#7471
rust-lang/rust-clippy#7473

cc @jackh726 @JohnTitor rust-lang/rust-clippy#7470 was caused by #86867. I saw the same ICE in the last rustup for Clippy though, so this might be a more general problem. Is there something we should check before calling layout_of? Should we always check for ty.has_escaping_bound_vars() before calling layout_of? Or is this overkill?

r? @Manishearth

Anthony Huang and others added 23 commits July 5, 2021 14:15
Add instructions to run from source

changelog: none

We often get messages on Zulip asking how to install and run Clippy from source. This adds instructions to the readme. I also added a note explaining that `cargo install --path . --force` is bad, which I just decided after some investigating. I use macOS. It would be nice to get some tests on other platforms to see if this is correct.
…matsakis

ExprUseVisitor: Treat ByValue use of Copy types as ImmBorrow

r? ```@nikomatsakis```
Remove refs from Pat slices

Changes `PatKind::Or(&'hir [&'hir Pat<'hir>])` to `PatKind::Or(&'hir [Pat<'hir>])` and others. This is more consistent with `ExprKind`, saves a little memory, and is a little easier to use.
Fix ICE in redundant_pattern_matching

Fixes rust-lang#7410

changelog: Fix ICE in `redundant_pattern_matching` in `no_std` crates.
Fix ICE in `is_integer_const`

fixes: rust-lang#7340
changelog: Fix ICE in `modulo_one` in const contexts
Use lang items for BinOp lints

changelog: none
…ishearth

New lint: [`self_named_constructor`]

Adds the `self_named_constructor` lint for detecting when an implemented method has the same name as the type it is implemented for.

changelog: [`self_named_constructor`]

closes: rust-lang#7142
Add check if ty has_escaping_bound_vars in zero_sized_map_values lint

Fixes: rust-lang#7447

changelog: fix ICE in [`zero_sized_map_values`]
Rustup

r? `@ghost`

Out of cycle sync for 2 ICE fixes rust-lang#7470 rust-lang#7471 rust-lang#7473

changelog: none
@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 Jul 19, 2021
@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jul 19, 2021

📌 Commit b10966b 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 Jul 19, 2021
@Manishearth
Copy link
Member

@bors p=1 rollup=maybe

@jackh726
Copy link
Member

Okay, regarding rust-lang/rust-clippy#7470, I would have to look into it, but it seems a bit suspicious to me. I think layout code should be fine to have bound vars (though, I'm not exactly sure if these should be wrapped in a Binder). It seems like that error is originating all the way in type_known_to_meet_bound_modulo_regions, where it expects ty to not have bound vars. I could conceivably think that we would allow Binder<Ty> there, but that's a bigger change.

Another option would be to normalize_erasing_late_bound_regions before calling layout_of, but I'm unsure if that is correct. This is tricky and definitely seems a bit weird.

@bors
Copy link
Contributor

bors commented Jul 19, 2021

⌛ Testing commit b10966b with merge fad295b...

@bors
Copy link
Contributor

bors commented Jul 19, 2021

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 19, 2021
@bors bors merged commit fad295b into rust-lang:master Jul 19, 2021
@rustbot rustbot added this to the 1.55.0 milestone Jul 19, 2021
@flip1995 flip1995 deleted the clippyup branch July 20, 2021 07:42
@flip1995
Copy link
Member Author

@jackh726 Thanks for the explanation. The normalize_erasing_late_bound_regions is another problem we had with layout_of before:

https://github.com/rust-lang/rust-clippy/blob/f467750680987427d7ff045bbe9e84317140d0aa/clippy_lints/src/zero_sized_map_values.rs#L58-L60

https://github.com/rust-lang/rust-clippy/blob/e9c3991d3081c79bd712d754e6f51f456e603c6c/clippy_utils/src/ty.rs#L182-L187

This problem is orthogonal to the has_escaping_bound_vars problem though, since removing the one of the two leads to 2 different ICEs when calling layout_of. It is definitely conceivable, that we misuse the layout_of query. But just from the documentation and looking at the code, I can't see what we're doing wrong.

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.