-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Error about redundant_explicit_links with conditional no_std #115637
Copy link
Copy link
Open
Labels
A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameArea: Intra-doc links, the ability to link to items in docs by nameA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameArea: Intra-doc links, the ability to link to items in docs by nameA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code:
And then ran this command:
RUSTDOCFLAGS="-D warnings" cargo +nightly docI expected to see this happen: Documents without errors.
Instead, this happened: Error that link target is redundant. Only happens if std feature is enabled because
Stringis in scope then. However, the explicit anchor is required for no_std.Perhaps, this is just an unfortunate situation where I need to use
#![allow(rustdoc::redundant_explicit_links)], but it was confusing at first.Meta
rustc --version --verbose: