Open
Description
Problem
When trying to build documentation for integration tests, the primary crate is not included and therefore cannot be found. This is useful for documenting common APIs in integration tests as documented
> cargo rustdoc --lib --test doctest
Documenting rustdoc-test-repro v0.1.0 (/home/bwidawsk/dev/rustdoc-test-repro)
error[E0432]: unresolved import `rustdoc_test_repro`
--> tests/main.rs:2:5
|
2 | use rustdoc_test_repro;
| ^^^^^^^^^^^^^^^^^^ no external crate `rustdoc_test_repro`
For more information about this error, try `rustc --explain E0432`.
error: could not document `rustdoc-test-repro`
Caused by:
process didn't exit successfully: `/home/bwidawsk/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustdoc --edition=2021 --crate-type bin --crate-name doctest tests/main.rs -o /home/bwidawsk/dev/rustdoc-test-repro/target/doc --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 -C metadata=82b36fa1636c8440 -L dependency=/home/bwidawsk/dev/rustdoc-test-repro/target/debug/deps --crate-version 0.1.0` (exit status: 1)
Steps
- Add documentation to an integration test
- build documentation something like:
cargo rustdoc --lib --test doctest
A simple reproducer is here. Simple run failure.sh
Possible Solution(s)
No response
Notes
No response
Version
cargo 1.75.0 (1d8b05cdd 2023-11-20)
release: 1.75.0
commit-hash: 1d8b05cdd1287c64467306cf3ca2c8ac60c11eb0
commit-date: 2023-11-20
host: x86_64-unknown-linux-gnu
libgit2: 1.7.1 (sys:0.18.1 vendored)
libcurl: 8.4.0-DEV (sys:0.4.68+curl-8.4.0 vendored ssl:OpenSSL/1.1.1u)
ssl: OpenSSL 1.1.1u 30 May 2023
os: Arch Linux Rolling Release [64-bit]