Closed
Description
Running
rustdoc -L target/debug/deps --test test.md
with the following content of test.md
```edition2018
// extern crate clap;
use clap::Arg;
```
gives me
running 1 test
test test.md - (line 1) ... FAILED
failures:
---- test.md - (line 1) stdout ----
error[E0432]: unresolved import `clap`
--> test.md:3:5
|
4 | use clap::Arg;
| ^^^^ use of undeclared type or module `clap`
thread 'test.md - (line 1)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:351:13
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
The test passes when I uncomment extern crate clap
.
This is a problem when code blocks in the documentation should get tested, see amethyst/amethyst#1364 (comment) for an example.
Meta
rustdoc --version --verbose
:
rustdoc 1.34.0-nightly (aadbc45 2019-02-23)
binary: rustdoc
commit-hash: aadbc45
commit-date: 2019-02-23
host: x86_64-unknown-linux-gnu
release: 1.34.0-nightly
LLVM version: 8.0