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

Reexport num_cpus in std::os. Closes #14707 #14938

Closed
wants to merge 1 commit into from

Conversation

japaric
Copy link
Member

@japaric japaric commented Jun 16, 2014

I'm not too confident about my approach regarding the handling of the docs, so here goes my train of thought:

The first commit does the reexport. But the side effect is that two num_cpus entries appear in the docs: std::os::num_cpus and std::rt::num_cpus, but we only need the former one.

The second commit deals with the duplicated entry. Is my first time using rustdoc, but I expected that a #[doc(hidden)] attribute on the pub use self::util::num_cpus would remove the duplicated entry - this didn't work and this seems like a bug to me (or it could be my inexperience with rustdoc). The only way I found to remove the duplicated entry was to make the util module public (this may not be acceptable), in addition to the #[doc(hidden)] attribute.

The third commit makes sure that other docs are kept intact (i.e. that the std::rt::util module doesn't appear in the docs).

cc @brson who requested the reexport, and @alexcrichton, who has been working on rustdoc lately.

@alexcrichton
Copy link
Member

Perhaps the num_cpus function could just move to the std::os module? I would like to keep std::rt::util private rather than making it public but hidden from the documentation.

I also don't think that doc(hidden) is recognized by rustdoc right now. Does it inline the documentation for you?

@japaric
Copy link
Member Author

japaric commented Jun 16, 2014

Perhaps the num_cpus function could just move to the std::os module?

I thought about doing this in the first place, but a reexport seemed more conservative than a move. If it's ok to move the function, I can try that in another PR.

I also don't think that doc(hidden) is recognized by rustdoc right now. Does it inline the documentation for you?

I probably worded that bad, doc(hidden) does hide the docs in some cases. What I meant to say is that I tried several (all?) combinations of doc attributes (hidden, no_inline, inline) on the reexports (pub use ...) in the first commit, but I could only get one of these two outcomes:

  • Both std::rt::num_cpus and std::os::num_cpus appear in the docs.
  • num_cpus doesn't appear in the docs at all.

But I couldn't the desired outcome: Only std::os::num_cpus in the docs - until I changed the visibility of the util module to public.

EDIT: Adding doc(hidden)/doc(no_inline) to the pub use self::util::num_cpus in the first commit, does not hide std::rt::num_cpus from the docs.

@alexcrichton
Copy link
Member

Let's move num_cpus to the os module in std, but it's ok to do it as part of this PR rather than opening another.

@japaric
Copy link
Member Author

japaric commented Jun 16, 2014

Let's move num_cpus to the os module in std

@alexcrichton done

@japaric japaric deleted the fix-14707 branch June 17, 2014 15:09
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2023
Add signature help for tuple patterns and expressions

~~These are somewhat wonky since their signature changes as you type depending on context but they help out nevertheless.~~ should be less wonky now with added parser and lowering recoveries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants