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

improve readability of winnowing #108937

Merged
merged 2 commits into from
Mar 11, 2023
Merged

improve readability of winnowing #108937

merged 2 commits into from
Mar 11, 2023

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Mar 9, 2023

No description provided.

@rustbot
Copy link
Collaborator

rustbot commented Mar 9, 2023

r? @WaffleLapkin

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 9, 2023
Co-authored-by: Ruby Lazuli <[email protected]>
Copy link
Member

@WaffleLapkin WaffleLapkin left a comment

Choose a reason for hiding this comment

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

Looks fine to me, r=me with the comment applied (or not if you don't think it's a good idea)

self.candidate_should_be_dropped_in_favor_of(
&candidates[i],
&candidates[j],
needs_infer,
)
) == DropVictim::Yes
Copy link
Member

Choose a reason for hiding this comment

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

Maybe .is_drop_victim() (or other check method) would be nicer here, idk.

@lcnr
Copy link
Contributor Author

lcnr commented Mar 10, 2023

hmm, I don't think adding that method is worth it 🤔 the method itself would also just be self == DropVictim::Yes, wouldn't it?

@bors r=WaffleLapkin rollup

@bors
Copy link
Contributor

bors commented Mar 10, 2023

📌 Commit 14818e2 has been approved by WaffleLapkin

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 Mar 10, 2023
@WaffleLapkin
Copy link
Member

the method itself would also just be self == DropVictim::Yes, wouldn't it?

Yeah.. But sometimes it can be beneficial for readability, as an example: #104786

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 11, 2023
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#106921 (Add documentation about the memory layout of `Cell`)
 - rust-lang#108828 (Emit alias-eq when equating numeric var and projection)
 - rust-lang#108834 (Do not ICE when we have fn pointer `Fn` obligations with bound vars in the self type)
 - rust-lang#108900 (fix(lexer): print whitespace warning for \x0c)
 - rust-lang#108930 (feat: implement better error for manual impl of `Fn*` traits)
 - rust-lang#108937 (improve readability of winnowing)
 - rust-lang#108947 (Don't even try to combine consts with incompatible types)
 - rust-lang#108976 (Update triagebot rust-analyzer team mention)
 - rust-lang#108983 (Forbid `#[target_feature]` on safe default implementations)

Failed merges:

 - rust-lang#108950 (Directly construct Inherited in typeck.)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 772b1ce into rust-lang:master Mar 11, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants