-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Remove a string comparison about types #99048
Conversation
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
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(); |
There was a problem hiding this comment.
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;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed that!
1cbfe97
to
01893d8
Compare
Thanks. This looks good now. @bors r+ |
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
No description provided.