Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cargo sometimes fails to generate documentation #4503

Closed
korteland opened this issue Sep 18, 2017 · 4 comments
Closed

Cargo sometimes fails to generate documentation #4503

korteland opened this issue Sep 18, 2017 · 4 comments

Comments

@korteland
Copy link

Specifically, it fails when:

  • documentation has never been generated for that crate
  • the crate has binaries in src/bin/foo.rs (as you would for a crate with multiple binaries).

To reproduce:

cargo new --bin tmp
cd tmp
cd src
mkdir bin
mv main.rs bin/
cd ..
cargo doc --open # fails to work
cargo run # works, prints "hello world"
@korteland
Copy link
Author

korteland commented Sep 18, 2017

For the time being, I've managed to work around it by creating a "hello, world" src/main.rs, running cargo doc --open, and removing the second main.rs. I can reliably generate documentation after this.

@korteland
Copy link
Author

Hmm. I just realised doc comments in src/bin/main.rs don't get rendered, even if cargo doc --open does something. Perhaps documentation generation for crates with multiple binaries is more broken than it first appeared? It seems like it should be supported.

@alexcrichton
Copy link
Member

Sounds like a bug! We may not be guessing the right crate name or something like that...

@ehuss
Copy link
Contributor

ehuss commented Sep 17, 2019

I'm not sure, but somewhere along the way this seems to have been fixed.

@ehuss ehuss closed this as completed Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants