Reexport num_cpus in std::os. Closes #14707
#14938
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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_cpusentries appear in the docs:std::os::num_cpusandstd::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 thepub use self::util::num_cpuswould remove the duplicated entry - this didn't work and this seems like a bug to me (or it could be my inexperience withrustdoc). The only way I found to remove the duplicated entry was to make theutilmodule 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::utilmodule doesn't appear in the docs).cc @brson who requested the reexport, and @alexcrichton, who has been working on rustdoc lately.