-
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
Fix intra doc link ICE when trying to get traits in scope for primitive #95645
Fix intra doc link ICE when trying to get traits in scope for primitive #95645
Conversation
@bors r+ |
📌 Commit 6d19eb8d5c90f9960080e140539992aff50f361c has been approved by |
let iter = cx.resolver_caches.traits_in_scope[&module].iter().flat_map(|trait_candidate| { | ||
let traits = match cx.resolver_caches.traits_in_scope.get(&module) { | ||
Some(t) => t, | ||
None => return Default::default(), |
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 hiding bugs. There should be no items for which rustdoc doesn't know the in-scope traits; if there are, it needs to be fixed or rustdoc will resolve links incorrectly.
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 was also my guess but I went for this in order to prevent the ICE in the time being. Do you prefer I add a FIXME comment and open an issue?
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.
Don't have a strong opinion. Just needs to be fixed at some point or there will be other bugs that arise.
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.
Ok. I'll investigate more and if I can't find what's going on, I'll add the FIXME and open an issue.
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.
Ah, funny case. The problem is that it's not i8
the type but i8
the module in the issue. I need to check why it's not added when --document-private-items
is used.
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.
Ok found the problem, we need to handle things a bit differently in case we have this option enabled.
@bors: r- |
6d19eb8
to
50cc0fa
Compare
So I found the root problem for this ICE: we only added public traits or traits from public modules. However, we forgot to take that into account when the |
@bors: r=jyn514 |
📌 Commit 50cc0fa has been approved by |
By the way, does |
Only on the current crate. |
…raits-in-scope-primitive, r=jyn514 Fix intra doc link ICE when trying to get traits in scope for primitive Fixes rust-lang#95633. I think `@notriddle` was the one who worked on this part of the code last so: r? `@notriddle`
Rollup of 5 pull requests Successful merges: - rust-lang#95234 (bootstrap.py: nixos check in /etc/os-release with quotes) - rust-lang#95449 (Fix `x doc --stage 0 compiler`) - rust-lang#95512 (diagnostics: translation infrastructure) - rust-lang#95607 (Note invariance reason for FnDef types) - rust-lang#95645 (Fix intra doc link ICE when trying to get traits in scope for primitive) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Nominating for beta backport as well. |
You may be interested in the perf data in #95667 (comment) before backporting. |
It seems surprising since it should only impact when rendering private items (unless that's what they do in the tests?). Let's run a perf check here directly to be sure this PR is the problem. @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
I don’t think we’re getting a |
Doesn't seem so... :-/ I'll ask around how to run perf check on this PR. |
I need to check what happens here, the |
@petrochenkov You were right, this PR is the one introducing the perf regression: #95682 (comment) I'm very curious why though... |
@GuillaumeGomez given how large the impact is, do you think it might be wise to revert this until we figure out what the issue is? |
Basically we have the choice between an ICE and a perf regression. I think it's better to keep the perf regression. I think @petrochenkov is already investigating this too so hopefully it should be fine before the next beta release in 6 weeks. I'll remove the beta backport nomination though. |
When documenting a bin crate, cargo always passes To confirm this theory, the worst-impacted crate is helloworld. A bin crate that depends on no lib crates (except the standard library, which doesn't get documented). |
Thanks for the information! I completely forgot that about binaries... |
That's fine, but I am worried about this getting lost. The recommended procedure in that case where a fix is not immediately obvious is to create an issue and assign yourself (or @petrochenkov) to it (though I realize this is also not a guarantee that the issue won't be lost). |
This is an excellent point. Opening an issue right away. EDIT: I opened #95694. |
Fixes #95633.
I think @notriddle was the one who worked on this part of the code last so:
r? @notriddle