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

use ty::Binder in rustdoc instead of skip_binder #105612

Merged
merged 4 commits into from
Dec 13, 2022

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Dec 12, 2022

r? @GuillaumeGomez

this is a preliminary cleanup required to be able to normalize correctly/conveniently in rustdoc

@rustbot
Copy link
Collaborator

rustbot commented Dec 12, 2022

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.

@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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Dec 12, 2022
@rustbot
Copy link
Collaborator

rustbot commented Dec 12, 2022

Some changes occurred in src/librustdoc/clean/types.rs

cc @camelid

Comment on lines 1462 to 1468
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);
}
}
Copy link
Contributor Author

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

@GuillaumeGomez
Copy link
Member

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.

@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 12, 2022

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 12, 2022
@bors
Copy link
Contributor

bors commented Dec 12, 2022

⌛ Trying commit 3075451 with merge 6db79ca755889bcf58901a8690ebec8615550c83...

@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 12, 2022

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

@bors
Copy link
Contributor

bors commented Dec 12, 2022

☀️ Try build successful - checks-actions
Build commit: 6db79ca755889bcf58901a8690ebec8615550c83 (6db79ca755889bcf58901a8690ebec8615550c83)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6db79ca755889bcf58901a8690ebec8615550c83): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Benchmarking 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 @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.4% [0.2%, 0.7%] 5
Regressions ❌
(secondary)
0.5% [0.3%, 0.7%] 12
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [0.2%, 0.7%] 5

Max RSS (memory usage)

Results

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-3.4%, -2.5%] 2
All ❌✅ (primary) - - 0

Cycles

Results

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.3% [2.1%, 4.4%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Dec 12, 2022
@GuillaumeGomez
Copy link
Member

It's very acceptable. Let's go then!

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Dec 12, 2022

📌 Commit 3075451 has been approved by GuillaumeGomez

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 Dec 12, 2022
@aDotInTheVoid
Copy link
Member

we should still land it as it's a correctness issue

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.

@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 13, 2022

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

@bors
Copy link
Contributor

bors commented Dec 13, 2022

⌛ Testing commit 3075451 with merge ed620cf...

@bors
Copy link
Contributor

bors commented Dec 13, 2022

☀️ Test successful - checks-actions
Approved by: GuillaumeGomez
Pushing ed620cf to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 13, 2022
@bors bors merged commit ed620cf into rust-lang:master Dec 13, 2022
@rustbot rustbot added this to the 1.68.0 milestone Dec 13, 2022
@oli-obk oli-obk deleted the bind_rustdoc branch December 13, 2022 15:50
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ed620cf): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.3% [0.2%, 0.5%] 5
Regressions ❌
(secondary)
0.5% [0.3%, 0.7%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.2%, 0.5%] 5

Max RSS (memory usage)

Results

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.8% [2.4%, 7.7%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 13, 2022

The regressions are expected, solely in rustdoc and part of a bugfix

@lqd
Copy link
Member

lqd commented Dec 13, 2022

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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. T-rustdoc Relevant to the rustdoc 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