You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Source: The Rust Programming Language
Author: Steve Klabnik, Carol Nichols
ISBN: 978-1-7185-0044-0
Date: 2018
According to page 20, cargo doc --open should build a documentation for the current binary project along with documentation for its dependencies. Currently, despite dependencies properly registered in Cargo.toml, the dependency documentation is not built and must be built manually via cargo doc -p $(cargo pkgid rand:0.3.23)
Steps
cargo new guessing_game
add rand = "0.3.23" to [dependencies] in Cargo.toml
inside /src/main.rs, place use rand::Rng; at the top of the file
Thanks for the detailed report! This is a known issue where if there are two crates with the same name, where one depends on the other, it ends up not documenting either (called the "semver trick"). Unfortunately the fix might be somewhat difficult or tricky. Closing as a duplicate of #10241.
For the sake of clarity, please tell me if my understanding is correct. I see in Cargo.lock that rand v0.3.23 depends on other versions of rand (v0.4.x). Because rand depends on rand, the documentation of rand will not be built with cargo doc?
Problem
Learning to use rust via:
Source: The Rust Programming Language
Author: Steve Klabnik, Carol Nichols
ISBN: 978-1-7185-0044-0
Date: 2018
According to page 20,
cargo doc --open
should build a documentation for the current binary project along with documentation for its dependencies. Currently, despite dependencies properly registered in Cargo.toml, the dependency documentation is not built and must be built manually viacargo doc -p $(cargo pkgid rand:0.3.23)
Steps
rand = "0.3.23"
to [dependencies] in Cargo.tomluse rand::Rng;
at the top of the filePossible Solution(s)
No response
Notes
No response
Version
Cargo.toml.txt
Cargo.lock.txt
The text was updated successfully, but these errors were encountered: