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

Remove cfg(doc) from std::os module reexports to fix rustdoc linking issues #88619

Merged
merged 4 commits into from
Sep 15, 2021

Conversation

GuillaumeGomez
Copy link
Member

Fixes #88304.

I tested it based on #88292.

Not sure if it's the best approach, but at least it makes thing a bit simpler.

cc @jyn514

@GuillaumeGomez GuillaumeGomez added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 3, 2021
@rust-highfive
Copy link
Collaborator

r? @joshtriplett

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 3, 2021
@rust-log-analyzer

This comment has been minimized.

@jyn514
Copy link
Member

jyn514 commented Sep 3, 2021

I don't think this is the right approach. We should find why the link-to-definition pass is broken and fix it, not change the standard library to avoid rustdoc bugs.

@jyn514 jyn514 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 3, 2021
@GuillaumeGomez
Copy link
Member Author

Well, it's not specific to the jump to definition feature. The link itself is correct after all... The problem is that we have a different rendering with "cfg(doc)". We literally can't fix it.

@jyn514
Copy link
Member

jyn514 commented Sep 3, 2021

Got it, that makes sense. This seems like a reasonable change then, to make the information available to rustdoc when documenting it as a dependency.

@jyn514 jyn514 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 3, 2021
@GuillaumeGomez
Copy link
Member Author

I'll check what's wrong with the changes I made.

@GuillaumeGomez
Copy link
Member Author

So: in the first commit I used cfg-if to have a clean state to work on. But because of rust-lang/rust-analyzer#6038, I removed it in the second commit and reverted back to code without macro.

@jyn514 jyn514 changed the title Simplify std::os module reexports to fix rustdoc linking issues Remove cfg(doc) from std::os module reexports to fix rustdoc linking issues Sep 3, 2021
@GuillaumeGomez
Copy link
Member Author

Seems like it's ready for review! :)

Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GuillaumeGomez I was planning to let @joshtriplett review, I don't think we should be changing fundamental things about libstd without asking T-libs.

Comment on lines 15 to 17
// so these modules are enabled when `cfg(doc)` is set.
// This should help show platform-specific functionality in a hopefully cross-platform
// way in the documentation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is out of date.

@GuillaumeGomez
Copy link
Member Author

@GuillaumeGomez I was planning to let @joshtriplett review, I don't think we should be changing fundamental things about libstd without asking T-libs.

Which is why I didn't set you as reviewer. ;)

But reviews from you remain very welcome!

@GuillaumeGomez GuillaumeGomez force-pushed the simplify-std-os-reexports branch 2 times, most recently from 0570239 to 85809ea Compare September 7, 2021 13:42
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
Copy link
Member Author

r? @Amanieu

@rust-highfive rust-highfive assigned Amanieu and unassigned joshtriplett Sep 9, 2021
@GuillaumeGomez
Copy link
Member Author

Updated!

@GuillaumeGomez
Copy link
Member Author

GuillaumeGomez commented Sep 13, 2021

@matthiaskrgr @camsteffen: Any idea what's going on with the clippy lint by any chance?

@camsteffen
Copy link
Contributor

That lint uses the absolute path of Permissions here and I'm guessing the path is changed. You can change the path in Clippy. The proper fix is to use a diagnostic item.

@GuillaumeGomez
Copy link
Member Author

Oh I see, thanks!

@GuillaumeGomez
Copy link
Member Author

@bors: r=Amanieu

@bors
Copy link
Contributor

bors commented Sep 13, 2021

📌 Commit 9a3b1cf has been approved by Amanieu

@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 Sep 13, 2021
Manishearth added a commit to Manishearth/rust that referenced this pull request Sep 14, 2021
…ports, r=Amanieu

Remove `cfg(doc)` from std::os module reexports to fix rustdoc linking issues

Fixes rust-lang#88304.

I tested it based on rust-lang#88292.

Not sure if it's the best approach, but at least it makes thing a bit simpler.

cc ``@jyn514``
Manishearth added a commit to Manishearth/rust that referenced this pull request Sep 14, 2021
…ports, r=Amanieu

Remove `cfg(doc)` from std::os module reexports to fix rustdoc linking issues

Fixes rust-lang#88304.

I tested it based on rust-lang#88292.

Not sure if it's the best approach, but at least it makes thing a bit simpler.

cc ```@jyn514```
Manishearth added a commit to Manishearth/rust that referenced this pull request Sep 14, 2021
…ports, r=Amanieu

Remove `cfg(doc)` from std::os module reexports to fix rustdoc linking issues

Fixes rust-lang#88304.

I tested it based on rust-lang#88292.

Not sure if it's the best approach, but at least it makes thing a bit simpler.

cc ````@jyn514````
@bors
Copy link
Contributor

bors commented Sep 15, 2021

⌛ Testing commit 9a3b1cf with merge e846f9c...

@bors
Copy link
Contributor

bors commented Sep 15, 2021

☀️ Test successful - checks-actions
Approved by: Amanieu
Pushing e846f9c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 15, 2021
@bors bors merged commit e846f9c into rust-lang:master Sep 15, 2021
@rustbot rustbot added this to the 1.57.0 milestone Sep 15, 2021
@GuillaumeGomez GuillaumeGomez deleted the simplify-std-os-reexports branch September 15, 2021 12:35
@bors bors mentioned this pull request Sep 15, 2021
4 tasks
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e846f9c): comparison url.

Summary: This benchmark run did not return any relevant changes.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

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. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library 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.

"jump to definition" feature is generating links to private item documentation pages