slint-ui/document-features

document-feature fails with multi-line `default` feature entry

dequbed opened this issue · 2 comments

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"
#![doc = document_features::document_features!()]

fn main() {
    println!("Hello, world!");
}

if the Cargo.toml is instead changed to the following (default put into a single line), everything works:

[package]
name = "dt"
version = "0.1.0"
edition = "2021"

[features]
default = [ "foo" ]

## Doc commment for this feature
foo = []

[dependencies]
document-features = "0.2.1"

Thanks for your bug report!

The 0.2.2 version was released on crates.io, that fixes the problem.