-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
use ty::Binder in rustdoc instead of skip_binder
#105612
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @GuillaumeGomez (or someone else) soon. Please see the contribution instructions for more information. |
Some changes occurred in src/librustdoc/clean/types.rs cc @camelid |
if let Some(normalized_value) = normalize(cx, ty::Binder::dummy(ty)) { | ||
return clean_middle_ty(normalized_value, cx, None); | ||
// `hir_to_ty` can return projection types with escaping vars for GATs, e.g. `<() as Trait>::Gat<'_>` | ||
if !ty.has_escaping_bound_vars() { | ||
if let Some(normalized_value) = normalize(cx, ty::Binder::dummy(ty)) { | ||
return clean_middle_ty(normalized_value, cx, None); | ||
} | ||
} |
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.
This is necessary due to the case that troubled us previously in #94683
Looks good to me, thanks! I don't think it'll have a perf impact but I'll let it up to you whether or not it should be in a rollup. r=me once CI pass. |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 3075451 with merge 6db79ca755889bcf58901a8690ebec8615550c83... |
Even if it regresses perf for rustdoc, we should still land it as it's a correctness issue and will prevent ICEs down the road |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (6db79ca755889bcf58901a8690ebec8615550c83): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
|
It's very acceptable. Let's go then! @bors r+ rollup=never |
May I ask, if this is a correctness fix, is their anything in particular that this fixes, or is this just moving to a more principled way that's less brittle. |
The latter. Right now all uses of normalization in rustdoc need to guard against broken types. This fixes that. I'll follow up with cleanups, but those may change rustdoc behaviour. The changes will be improvements to generics-heavy code |
☀️ Test successful - checks-actions |
Finished benchmarking commit (ed620cf): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesThis benchmark run did not return any relevant results for this metric. |
The regressions are expected, solely in rustdoc and part of a bugfix |
@rustbot label: +perf-regression-triaged |
r? @GuillaumeGomez
this is a preliminary cleanup required to be able to normalize correctly/conveniently in rustdoc