-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Re-exports of hidden items are inconsistent #137342
Comments
Has anyone started this issue already? Maybe I could try it. @lolbinarycat |
@xizheyin do you have any experience working on rustdoc? this is not a trivial issue. |
I have previously used librustdoc to create a small tool,but I only utilized a part of the |
I imagine it's an issue with the pass that removes doc(hidden) items. It might require a bit of refactoring to solve this issue in a performant way. |
Ok, I'll take a deeper look. If the bug isn't particularly urgent. |
@rustbot claim |
I have tried to inline Update: |
@xizheyin i don't have the final say on what the "right" way to fix it is, but if it was up to me, all 4 functions would be inlined. figuring out how to do this efficiently without introducing new bugs is the hard part. |
yeah,that is what i have done. But it may conflict with the existing testcase. |
@xizheyin if you look inside the testcase that's failing, you'll see it link to issue #109449 if you follow the links from that issue, you'll find pr #112304 that pr contains a section explaining what the intended behavior is. from my reading it seems to indicate that |
@GuillaumeGomez is my understanding of the intended behavior here correct? is this a regression? |
The rules are described here. In particular:
|
So |
@GuillaumeGomez please look at the linked example. |
Hum I think it's a case that we didn't check. The docs say it's not supposed to be visible, even with So yes, |
OK, let me try to fix it. |
@GuillaumeGomez Wait, hidden items shouldn't be visible, even when explicitly inlined? This isn't entirly clear from reading the docs, but I guess that's what's meant by "(because the re-export itself and its attributes are ignored)". If that's the case, then shouldn't |
Hum, the reexport itself is not doc hidden. So I'd tend to say yes but unclear. |
Sounds like the docs also need some clarification. |
Both are welcome. |
After I finish the code, and test it the outputs is
10 previous testcases failed. Here is an example:
By the logic we discussed, |
Seems like the logic is that So back to your example, what's weird is that if you have a reexport of a reexport of a hidden item, it's inlined whereas it shouldn't. |
I have two modification logics
When I use both logic 1 and 2, 10 testcases failed; when I use only logic 1, only 5 testcases failed. |
When I use only logic 1, it failed the testcases as below:
|
It should be 1 normally. If you use |
…iddle Add missing case explanation for doc inlined re-export of doc hidden item This case was not covered in the rustdoc book as uncovered in rust-lang#137342. r? `@notriddle`
…iddle Add missing case explanation for doc inlined re-export of doc hidden item This case was not covered in the rustdoc book as uncovered in rust-lang#137342. r? ``@notriddle``
Rollup merge of rust-lang#137719 - GuillaumeGomez:missing-doc, r=notriddle Add missing case explanation for doc inlined re-export of doc hidden item This case was not covered in the rustdoc book as uncovered in rust-lang#137342. r? ``@notriddle``
…Gomez [rustdoc] hide item that is not marked as doc(inline) and whose src is doc(hidden) Part of rust-lang#137342 
…Gomez [rustdoc] hide item that is not marked as doc(inline) and whose src is doc(hidden) Part of rust-lang#137342 
…Gomez [rustdoc] hide item that is not marked as doc(inline) and whose src is doc(hidden) Part of rust-lang#137342 
…Gomez [rustdoc] hide item that is not marked as doc(inline) and whose src is doc(hidden) Part of rust-lang#137342 
…Gomez [rustdoc] hide item that is not marked as doc(inline) and whose src is doc(hidden) Part of rust-lang#137342 
…Gomez [rustdoc] hide item that is not marked as doc(inline) and whose src is doc(hidden) Part of rust-lang#137342 
…Gomez [rustdoc] hide item that is not marked as doc(inline) and whose src is doc(hidden) Part of rust-lang#137342 
…Gomez [rustdoc] hide item that is not marked as doc(inline) and whose src is doc(hidden) Part of rust-lang#137342 
…Gomez [rustdoc] hide item that is not marked as doc(inline) and whose src is doc(hidden) Part of rust-lang#137342 
…Gomez [rustdoc] hide item that is not marked as doc(inline) and whose src is doc(hidden) Part of rust-lang#137342 
Rollup merge of rust-lang#137534 - xizheyin:issue-137342, r=GuillaumeGomez [rustdoc] hide item that is not marked as doc(inline) and whose src is doc(hidden) Part of rust-lang#137342 
example
If an item in a hidden module is reexported, it will be automatically inlined, but if the item itself is hidden (and in a non-hidden module), it will show as a regular reexport, with a link to a normally hidden page.
This also makes the item not show in the "all items" list, despite being publicly reachable.
The text was updated successfully, but these errors were encountered: