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.
AFAICT, if your crate has this line:
#![cfg_attr(not(feature = "std"), no_std)]and you use a intra-rustdoc link for any
stditem, these lines must be added to build documentation with--no-default-features:Then, to use items from the prelude in documentation, you'll also want:
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
stdcrate would always be in scope.