-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
A-examplesArea: example targetsArea: example targetsC-bugCategory: bugCategory: bugCommand-docE-easyExperience: EasyExperience: Easy
Description
Problem
With --examples
, cargo doc
is supposed to document your examples too. However, the examples may need dev dependencies in order to compile, and cargo doc
does not include those, leading to errors about unresolved imports.
Steps
- git clone git@github.com:asomers/mockall.git
- cd mockall
- cargo doc --examples
...
error[E0432]: unresolved import `mockall_double`
--> mockall/examples/ffi.rs:8:5
|
8 | use mockall_double::double;
| ^^^^^^^^^^^^^^ use of undeclared crate or module `mockall_double`
|
help: there is a crate or module with a similar name
|
8 | use mockall_derive::double;
| ~~~~~~~~~~~~~~
...
Possible Solution(s)
cargo doc --examples
should resolve dev-dependencies, just like cargo check --examples
does.
Notes
No response
Version
> cargo version --verbose
cargo 1.60.0-nightly (95bb3c92b 2022-01-18)
release: 1.60.0-nightly
commit-hash: 95bb3c92bf516017e812e7f1c14c2dea3845b30e
commit-date: 2022-01-18
host: x86_64-unknown-freebsd
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.80.0-DEV (sys:0.4.51+curl-7.80.0 vendored ssl:OpenSSL/1.1.1l)
os: FreeBSD 14.0-CURRENT [64-bit]
lukehsiao
Metadata
Metadata
Assignees
Labels
A-examplesArea: example targetsArea: example targetsC-bugCategory: bugCategory: bugCommand-docE-easyExperience: EasyExperience: Easy