Skip to content
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

Remove a string comparison about types #99048

Merged
merged 1 commit into from
Jul 9, 2022

Conversation

TaKO8Ki
Copy link
Member

@TaKO8Ki TaKO8Ki commented Jul 8, 2022

No description provided.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 8, 2022
@rust-highfive
Copy link
Contributor

r? @oli-obk

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 8, 2022
if let ty::Adt(adt, _) = peeled.kind()
&& self.tcx.is_diagnostic_item(sym::String, adt.did())
{
let ref_cnt = ty.to_string().len() - peeled.to_string().len();
Copy link
Member

Choose a reason for hiding this comment

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

Do you mind removing this string comparison too? I think it's checking how many ty::Ref we are wrapped in. You can probably count this by replacing ty.peel_refs() with a while let, something like:

let mut peeled = ty;
while let ty::Ref(_, inner, _) = peeled.kind() {
  peeled = *inner;
  ref_cnt += 1;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

I fixed that!

@oli-obk
Copy link
Contributor

oli-obk commented Jul 8, 2022

r? @compiler-errors

@TaKO8Ki TaKO8Ki force-pushed the remove-type-string-comparison branch from 1cbfe97 to 01893d8 Compare July 8, 2022 15:09
@compiler-errors
Copy link
Member

Thanks. This looks good now.

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 8, 2022

📌 Commit 01893d8 has been approved by compiler-errors

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 Jul 8, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 9, 2022
Rollup of 7 pull requests

Successful merges:

 - rust-lang#98350 (Implement support for DWARF version 5.)
 - rust-lang#98915 (Clarify deriving code)
 - rust-lang#98980 (fix ICE in ConstProp)
 - rust-lang#99008 (Adding suggestion for E0530)
 - rust-lang#99043 (Collapse some weirdly-wrapping derives)
 - rust-lang#99048 (Remove a string comparison about types)
 - rust-lang#99070 (Update integer_atomics tracking issue)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 80a74bf into rust-lang:master Jul 9, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jul 9, 2022
# for free to join this conversation on GitHub. Already have an account? # 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.

6 participants