-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
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 nameC-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.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.
Description
AFAICT, if your crate has this line:
#![cfg_attr(not(feature = "std"), no_std)]and you use a intra-rustdoc link for any std item, these lines must be added to build documentation with --no-default-features:
#[cfg(doc)]
extern crate std;Then, to use items from the prelude in documentation, you'll also want:
#[cfg(doc)]
use std::prelude::v1::*However, this defeats the purpose of the prelude being imported automatically. Would it be possible for rustdoc to add these lines even when building with #![no_std]?
This should also help solve #73423, because the std crate would always be in scope.
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 nameC-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.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.