Description
Consider the following Cargo.toml
(some contents are redundant, but they're there to be explicit).
[package]
name = "foo"
version = "0.1.0"
authors = ["Some Body <nobody@nowhere.org>"]
[lib]
name = "foo_bar"
path = "src/lib.rs"
doc = true
[[bin]]
name = "foo-bar"
path = "src/main.rs"
doc = true
When cargo doc
is run, the resulting documentation has one entry for the crate foo_bar
, displaying the documentation extracted from the binary target foo-bar
. I presume this has something to do with the the historical "hyphens are underscores in crate names," and I recognize it's quite the edge case, but it just took me about half an hour to figure this out just now and I figured I'd say something about it anyway. It'd be nice if the result would be something more like foo_bar
and foo-bar
docs, or even something like foo_bar_lib
and foo_bar_bin
.
I'm using cargo 1.26.0 and rustdoc 1.26.0, though I first noticed the issue using cargo nightly (2018-05-07).