Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I generate cargo docs for all platforms?

The cargo command line tool allows me to generate documentation for my crate, but I have structures like:

#[cfg(target-platform("windows")]
mod winstuff {
     /// Explanation of Windows-specific tasks
}

#[cfg(target-platfrom("linux")]
mod linstuff {
    /// Explanation of Linux-specific tasks
}

When I run cargo docs --no-deps, only the platform-specific module I'm generating documentation for gets generated. How can I generate documentation for all platforms?

like image 522
Valarauca Avatar asked Nov 18 '16 16:11

Valarauca


People also ask

What is cargo generate?

cargo-generate is a developer tool to help you get up and running quickly with a new Rust project by leveraging a pre-existing git repository as a template.

Where is cargo build output?

Cargo stores the output of a build into the "target" directory. By default, this is the directory named target in the root of your workspace.

Where are cargo binaries stored?

All binaries installed with cargo install are stored in the installation root's bin folder. If you installed Rust using rustup.rs and don't have any custom configurations, this directory will be $HOME/. cargo/bin. Ensure that directory is in your $PATH to be able to run programs you've installed with cargo install .

What does cargo Doc do?

When no target selection options are given, cargo doc will document all binary and library targets of the selected package. The binary will be skipped if its name is the same as the lib target. Binaries are skipped if they have required-features that are missing.


1 Answers

This is a known bug, there is no current fix.

like image 80
Valarauca Avatar answered Nov 09 '22 06:11

Valarauca