-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
rustdoc: run more HIR validation to mirror rustc #108576
rustdoc: run more HIR validation to mirror rustc #108576
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
ca2336a
to
d9fec98
Compare
This comment has been minimized.
This comment has been minimized.
tests/rustdoc-ui/issue-105742.rs
Outdated
use std::ops::Index; | ||
|
||
pub fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) { | ||
//~^ERROR |
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.
Question: Is there a nicer way to do this if you are not looking to tests the specific errors?
Or should I just write out all the errors produced here properly?
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.
Writing the beginning of the error message would be nice indeed. No need for more I think.
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.
- will do
r? rustdoc |
Looks good to me, thanks for doing the investigation. Let's run a perf check. @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 21af8fee68cc627d3f6000e52f8ed100f750cf39 with merge 6ce32053507e9465bfc6a4395c317c3cfac77baf... |
☀️ Try build successful - checks-actions |
1 similar comment
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (6ce32053507e9465bfc6a4395c317c3cfac77baf): comparison URL. Overall result: ❌✅ regressions and improvements - 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 does have an impact on performance. I suppose it's fine but let's see with the other rustdoc people. @rfcbot fcp merge |
Team member @GuillaumeGomez has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
⌛ Testing commit a75e290178d52d710c29eec027aa1ea4a8fd155e with merge 962989bb1245bd59506ba10377913aad3e14541d... |
💔 Test failed - checks-actions |
There are tidy errors:
I'm surprised they weren't caught before... |
This comment has been minimized.
This comment has been minimized.
a75e290
to
1f9e2d0
Compare
@bors r=GuillaumeGomez |
☀️ Test successful - checks-actions |
Finished benchmarking commit (789ee5e): comparison URL. Overall result: ❌ regressions - no action needed@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. |
Explanation
While investigating these issues: #107093, #106079
I thought it maybe would be useful to test running
rustdoc
on all rust files undertests/ui
grepping for files that causes any ICEs.And these are the files I found would cause ICEs.
I reduces the issues handled by this PR down to the tests added in the PR. That includes the linked issues.
But the 3 files that are not handled I will leave for a future PR.
This PR adds the
type_collecting
step fromhir_analysis::check_crate
to the rustdoc typechecks.It had the following comment on it.
Adding the check report the same errors as rustc does for these input.
And not ICE when the lint checker walks the HIR or when in the
rustdoc::clean
pass.This PR updates the expected errors of some existing rustdoc-ui tests (some now report less errors).
These new reported errors does mirror the errors reported by rustc.
Performance
It does more checking so it will probably regress. We should run
@bors try @rust-timer queue
and see.Discussion
Maybe instead of calling a subset of the checks in
hir_analysis::check_crate
and having comments that say they should be kept in sync. We could instead callcheck_crate
directly and pass in some flag. Maybecheck_toplevel_signatures_only
or something like that. That flag would have to skip most of the checks in that function tough.