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

Merged
merged 86 commits into from
Feb 10, 2023
Merged

Update Clippy #107886

merged 86 commits into from
Feb 10, 2023

Conversation

flip1995
Copy link
Member

r? @Manishearth

One day late. Sorry forgot about it yesterday :|

tgross35 and others added 30 commits December 30, 2022 16:10
Rollup of 9 pull requests

Successful merges:

 - rust-lang#106806 (Replace format flags u32 by enums and bools.)
 - rust-lang#107194 (Remove dependency on slice_internals feature in rustc_ast)
 - rust-lang#107234 (Revisit fix_is_ci_llvm_available logic)
 - rust-lang#107316 (Update snap from `1.0.1` to `1.1.0`)
 - rust-lang#107321 (solver comments + remove `TyCtxt::evaluate_goal`)
 - rust-lang#107332 (Fix wording from `rustbuild` to `bootstrap`)
 - rust-lang#107347 (reduce rightward-drift)
 - rust-lang#107352 (compiler: Fix E0587 explanation)
 - rust-lang#107357 (Fix infinite loop in rustdoc get_all_import_attributes function)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
…li-obk

Compute generator saved locals on MIR

Generators are currently type-checked by introducing a `witness` type variable, which is unified with a `GeneratorWitness(captured types)` whose purpose is to ensure that the auto traits correctly migrate from the captured types to the `witness` type.  This requires computing the captured types on HIR during type-checking, only to re-do it on MIR later.

This PR proposes to drop the HIR-based computation, and only keep the MIR one.  This is done in 3 steps.
1. During type-checking, the `witness` type variable is never unified.  This allows to stall all the obligations that depend on it until the end of type-checking.  Then, the stalled obligations are marked as successful, and saved into the typeck results for later verification.
2. At type-checking writeback, `witness` is replaced by `GeneratorWitnessMIR(def_id, substs)`.  From this point on, all trait selection involving `GeneratorWitnessMIR` will fetch the MIR-computed locals, similar to what opaque types do.  There is no lifetime to be preserved here: we consider all the lifetimes appearing in this witness type to be higher-ranked.
3. After borrowck, the stashed obligations are verified against the actually computed types, in the `check_generator_obligations` query.  If any obligation was wrongly marked as fulfilled in step 1, it should be reported here.

There are still many issues:
- ~I am not too happy having to filter out some locals from the checked bounds, I think this is MIR building that introduces raw pointers polluting the analysis;~ solved by a check specific to static variables.
- the diagnostics for captured types don't show where they are used/dropped;
- I do not attempt to support chalk.

cc `@eholk` `@jyn514` for the drop-tracking work
r? `@oli-obk` as you warned me of potential unsoundness
…ebank

Remove overlapping parts of multipart suggestions

This PR adds a debug assertion that the parts of a single substitution cannot overlap, fixes a overlapping substitution from the testsuite, and fixes rust-lang#106870.

Note that a single suggestion can still have multiple overlapping substitutions / possible edits, we just don't suggest overlapping replacements in a single edit anymore.

I've also included a fix for an unrelated bug where rustfix for `explicit_outlives_requirements` would produce multiple trailing commas for a where clause.
Remove `ControlFlow::{BREAK, CONTINUE}`

Libs-API decided to remove these in rust-lang#102697.

Follow-up to rust-lang#107023, which removed them from `compiler/`, but a couple new ones showed up since that was merged.

r? libs
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#104012 (Improve unexpected close and mismatch delimiter hint in TokenTreesReader)
 - rust-lang#104252 (Stabilize the const_socketaddr feature)
 - rust-lang#105524 (Replace libc::{type} with crate::ffi::{type})
 - rust-lang#107096 (Detect references to non-existant messages in Fluent resources)
 - rust-lang#107355 (Add regression test for rust-lang#60755)
 - rust-lang#107384 (Remove `BOOL_TY_FOR_UNIT_TESTING`)
 - rust-lang#107385 (Use `FallibleTypeFolder` for `ConstInferUnifier` not `TypeRelation`)
 - rust-lang#107391 (rustdoc: remove inline javascript from copy-path button)
 - rust-lang#107398 (Remove `ControlFlow::{BREAK, CONTINUE}`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Remove HirId -> LocalDefId map from HIR.

Having this map in HIR prevents the creating of new definitions after HIR has been built.
Thankfully, we do not need it.

Based on rust-lang#103902
COLLAPSIBLE_STR_REPLACE uses msrvs::PATTERN_TRAIT_CHAR_ARRAY
SEEK_FROM_CURRENT uses msrvs::SEEK_FROM_CURRENT
SEEK_REWIND uses msrvs::SEEK_REWIND
UNNECESSARY_LAZY_EVALUATIONS uses msrvs::BOOL_THEN_SOME for `then` to
`then_some`
TRANSMUTE_PTR_TO_REF uses msrvs::POINTER_CAST
ALMOST_COMPLETE_RANGE uses msrvs::RANGE_INCLUSIVE
NEEDLESS_BORROW uses msrvs::ARRAY_INTO_ITERATOR
DERIVABLE_IMPLS uses msrvs::DEFAULT_ENUM_ATTRIBUTE
kartva and others added 14 commits February 5, 2023 01:18
…ious-to-owned, r=Jarcho

fix(suspicious_to_owned): use span_suggestions to suggest both intents

fixes rust-lang#10294

changelog: [`suspicious_to_owned`]: suggestions now produce valid Rust code
…tion, r=dswij

Negate suggestions when needed in `bool_assert_comparison`

changelog: none assuming this gets into the same release as rust-lang#10218

Fixes rust-lang#10291

r? `@dswij`

Thanks to `@black-puppydog` for spotting it early
…ump, r=flip1995

Make `[clippy::dump]` support trait items

Roses are red,
violets are blue,
trait items are rare,
`[clippy::dump]` is too

---

Let's just ignore the horrible poem... anyways. While working on Marker I noticed, that `[clippy::dump]` doesn't work on trait item (See [Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=e2d9791ffa2872e7c09a9dfbd470350c)). This simply adds support for that. `[clippy::dump]` doesn't have UI tests, to make it more resistant to changes in the AST. I tested it locally and the dump works after these changes.

---

changelog: none
Clap was updated in rust-lang/rust-clippy#10270, which broke the command
line of clippy_dev. This swaps out contains_id, which now returns always
true in the places it was used with get_flag.
Fix CLI of clippy_dev

Clap was updated in rust-lang/rust-clippy#10270, which broke the command line of clippy_dev. This swaps out contains_id, which now returns always true in the places it was used with get_flag.

r? `@xFrednet`

This should also fix https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/.60cargo.20dev.20setup.20intellij.60.20is.20degraded/near/325770850

changelog: none
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 10, 2023
@rustbot
Copy link
Collaborator

rustbot commented Feb 10, 2023

These commits modify the Cargo.lock file. Random changes to Cargo.lock can be introduced when switching branches and rebasing PRs.
This was probably unintentional and should be reverted before this PR is merged.

If this was intentional then you can ignore this comment.

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@Manishearth
Copy link
Member

@bors r+ p=1

@bors
Copy link
Contributor

bors commented Feb 10, 2023

📌 Commit 5566eb4 has been approved by Manishearth

It is now in the queue for this repository.

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

bors commented Feb 10, 2023

⌛ Testing commit 5566eb4 with merge 2773383...

@bors
Copy link
Contributor

bors commented Feb 10, 2023

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 10, 2023
@bors bors merged commit 2773383 into rust-lang:master Feb 10, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 10, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2773383): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.8% [-1.8%, -1.8%] 1
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

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.