First of all, this is my first question here, so I might mistake something.
Please tell me if you find I have broken some rule or whatever.
I was building a doc for some crate, and I got errors like
error[E0554]: `#![feature]` may not be used on the stable release channel
--> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/bytes-1.4.0/src/lib.rs:7:21
|
7 | #![cfg_attr(docsrs, feature(doc_cfg))]
| ^^^^^^^^^^^^^^^^
error: Compilation failed, aborting rustdoc
For more information about this error, try `rustc --explain E0554`.
error: could not document `bytes`
So I used the nightly version of rustdoc, and then I got another error:
error[E0658]: `#[doc(cfg)]` is experimental
--> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/rxml-0.8.2/src/lib.rs:196:20
|
196 | #[cfg_attr(docsrs, doc(cfg(feature = "async")))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #43781 <https://github.com/rust-lang/rust/issues/43781> for more information
= help: add `#![feature(doc_cfg)]` to the crate attributes to enable
If I understand correctly, rxml
is an external crate and I can't insert #![feature()]
attribute in it.
To test my assumption, I created a fresh new library crate
cargo new --lib doc-rxml
Then I added only the rxml
dependency with version 0.9.1
[dependencies]
rxml = "0.9.1"
Then I attempted to build a document with the nightly compiler, which gave me the exact same error.
error[E0658]: `#[doc(cfg)]` is experimental
--> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/rxml-0.9.1/src/lib.rs:196:20
|
196 | #[cfg_attr(docsrs, doc(cfg(feature = "async")))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #43781 <https://github.com/rust-lang/rust/issues/43781> for more information
= help: add `#![feature(doc_cfg)]` to the crate attributes to enable
For more information about this error, try `rustc --explain E0658`.
error: could not document `rxml`
So my question is, how can I actually build a document of dependency crate, which doesn't have #![feature(doc_cfg)]
itself?
Thanks in advance and sorry for my poor English.