Skip to content

Track if a where bound comes from a impl Trait desugar #96770

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
May 8, 2022

Conversation

flip1995
Copy link
Member

@flip1995 flip1995 commented May 6, 2022

With #93803 impl Trait function arguments get desugared to hidden where bounds. However, Clippy needs to know if a bound was originally a impl Trait or an actual bound. This adds a field to the WhereBoundPredicate struct to keep track of this information during AST->HIR lowering.

r? @cjgillot

cc @estebank (as the reviewer of #93803)

This reverts commit bb01aca.

Partial: Keep regression tests
@rust-highfive
Copy link
Contributor

Some changes occurred in src/tools/clippy.

cc @rust-lang/clippy

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 6, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 6, 2022
@cjgillot cjgillot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 6, 2022
@estebank
Copy link
Contributor

estebank commented May 7, 2022

r=me after addressing cjgillot's comment

@flip1995 flip1995 force-pushed the fix-trait-type-in-bounds branch from bfa15d6 to 65e38fa Compare May 7, 2022 13:39
With rust-lang#93803 `impl Trait` function arguments get desugared to hidden
where bounds. However, Clippy needs to know if a bound was originally a
impl Trait or an actual bound. This adds a field to the
`WhereBoundPredicate` struct to keep track of this information during
HIR lowering.
@flip1995 flip1995 force-pushed the fix-trait-type-in-bounds branch from 65e38fa to dd1ff40 Compare May 7, 2022 15:10
@flip1995
Copy link
Member Author

flip1995 commented May 7, 2022

I think I addressed everything.

@cjgillot
Copy link
Contributor

cjgillot commented May 7, 2022

@bors r+

@bors
Copy link
Collaborator

bors commented May 7, 2022

📌 Commit dd1ff40 has been approved by cjgillot

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 7, 2022
@bors
Copy link
Collaborator

bors commented May 8, 2022

⌛ Testing commit dd1ff40 with merge ed3164b...

@bors
Copy link
Collaborator

bors commented May 8, 2022

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing ed3164b to master...

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

Finished benchmarking commit (ed3164b): 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

xFrednet pushed a commit to xFrednet/rust that referenced this pull request May 21, 2022
…cjgillot

Track if a where bound comes from a impl Trait desugar

With rust-lang#93803 `impl Trait` function arguments get desugared to hidden where bounds. However, Clippy needs to know if a bound was originally a `impl Trait` or an actual bound. This adds a field to the `WhereBoundPredicate` struct to keep track of this information during AST->HIR lowering.

r? `@cjgillot`

cc `@estebank` (as the reviewer of rust-lang#93803)
# for free to join this conversation on GitHub. Already have an account? # 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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants