Closed
Description
With the following crate:
#![feature(doc_cfg)]
#[doc(cfg(unix))]
pub struct SomeStruct;
Attempting to build it on stable will fail as expected, but generating docs will pass, no problem:
$ cargo +stable build
Compiling asdf v0.1.0 (/home/misdreavus/git/asdf)
error[E0554]: #![feature] may not be used on the stable release channel
--> src/lib.rs:1:1
|
1 | #![feature(doc_cfg)]
| ^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0554`.
error: Could not compile `asdf`.
To learn more, run the command again with --verbose.
$ cargo +stable doc
Documenting asdf v0.1.0 (/home/misdreavus/git/asdf)
Finished dev [unoptimized + debuginfo] target(s) in 0.79s
The output docs also happily use the feature in question:
I would expect rustdoc to also choke on the #![feature]
attribute, but it turns out that it doesn't. This is probably not an issue in practice, but this doesn't seem intended?