Closed
Description
Problem
When a crate has a dash (-
) in its name, the unstable rustdoc-scrape-examples
option stops working.
Steps
- Create a crate with a dash in it's name:
cargo new --lib da-sh && cd da-sh
- Add a function to the crate:
echo "pub fn f() {}" >> src/lib.rs
- Add an example that uses the added function:
mkdir examples && echo "fn main() { da_sh::f() }" > examples/e.rs
- Run
rustdoc
:cargo +nightly doc -Zunstable-options -Zrustdoc-scrape-examples=examples --open
- Observe documentation of
f
(example is missing): - Remove dash from the crate name:
sed -i 's/da-sh/dash/' Cargo.toml && sed -i 's/da_sh/dash/' examples/e.rs
- Run
rustdoc
:cargo +nightly doc -Zunstable-options -Zrustdoc-scrape-examples=examples --open
- Observe documentation of
f
(example is present):
Possible Solution(s)
No response
Notes
I'm not sure if this is an issue with rustdoc
or cargo
, maybe this issue should be moved to rustdoc
repo.
Version
cargo 1.58.0-nightly (94ca096af 2021-10-29)