if the entry for the default feature spans multiple lines trying to run cargo doc will return an error:
error: Parse error while parsing dependency default
--> src/main.rs:1:10
|
1 | #![doc = document_features::document_features!()]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro `document_features::document_features` (in Nightly builds, run with -Z macro-backtrace for more info)
error: Compilation failed, aborting rustdoc
minimal Cargo.toml & main.rs required for this behaviour:
[package]
name = "dt"
version = "0.1.0"
edition = "2021"
[features]
default = [
"foo"
]
## Doc commment for this feature
foo = []
[dependencies]
document-features = "0.2.1"
if the entry for the
default
feature spans multiple lines trying to runcargo doc
will return an error:minimal
Cargo.toml
&main.rs
required for this behaviour:if the Cargo.toml is instead changed to the following (
default
put into a single line), everything works: