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

intra doc links to std::env render incorrectly by including module@ disambiguator #75706

Closed
lopopolo opened this issue Aug 19, 2020 · 2 comments
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@lopopolo
Copy link
Contributor

I tried this code at the suggestion of the compiler to disanbiguate between the std::env module and std::env! macro:

//! - **core-env-system** - Activates the [`module@std::env`] backend for the
//!   [`ENV` object][core-obj-env]. When this feature is disabled, access to the
//!   environ is emulated with an in-memory store.

I expected to see this happen: a rendered docstring like:

core-env-system - Activates the std::env backend for the ENV object. When this feature is disabled, access to the environ is emulated with an in-memory store.

Instead, this happened: The module disambiguator was included in the rendered docs:

core-env-system - Activates the module@std::env backend for the ENV object. When this feature is disabled, access to the environ is emulated with an in-memory store.

Meta

$ cargo +nightly --version
cargo 1.47.0-nightly (ab32ee88d 2020-08-10)
[06:56] [~/dev/artichoke/artichoke]
$ rustc +nightly -Vv
rustc 1.47.0-nightly (30f0a0768 2020-08-18)
binary: rustc
commit-hash: 30f0a07684f6c1f5df62d69e9519d82e13d6bf2d
commit-date: 2020-08-18
host: x86_64-apple-darwin
release: 1.47.0-nightly
LLVM version: 10.0
[06:56] [~/dev/artichoke/artichoke]
$ rustdoc +nightly -Vv
rustdoc 1.47.0-nightly (30f0a0768 2020-08-18)
binary: rustdoc
commit-hash: 30f0a07684f6c1f5df62d69e9519d82e13d6bf2d
commit-date: 2020-08-18
host: x86_64-apple-darwin
release: 1.47.0-nightly
LLVM version: 10.0
@lopopolo lopopolo added the C-bug Category: This is a bug. label Aug 19, 2020
@lopopolo
Copy link
Contributor Author

A workaround is to write the doc string like this:

//! - **core-env-system** - Activates the [`std::env`](module@std::env) backend
//!   for the [`ENV` object][core-obj-env]. When this feature is disabled,
//!   access to the environ is emulated with an in-memory store.

@jonas-schievink jonas-schievink added A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Aug 19, 2020
@jyn514
Copy link
Member

jyn514 commented Aug 19, 2020

Duplicate of #65354

@jyn514 jyn514 marked this as a duplicate of #65354 Aug 19, 2020
@jyn514 jyn514 closed this as completed Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants