Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doctest dependencies don't seem to be taken into account #52

Open
nmattia opened this issue Feb 5, 2020 · 3 comments
Open

doctest dependencies don't seem to be taken into account #52

nmattia opened this issue Feb 5, 2020 · 3 comments

Comments

@nmattia
Copy link

nmattia commented Feb 5, 2020

I believe this is the case. In particular I have a crate with a doctest that uses serde_json:

/// ```
/// use serde_json;
/// ... (use serde_json here)

and cargo udeps reports the crate as not being used:

my_crate v0.1.0 (/path/to/my_crate)`
└─── (dev-)dependencies
     └─── "serde_json"

However cargo test (correctly) fails if I remove the crate.

(note: I'm running cargo udeps --all-targets).

@est31
Copy link
Owner

est31 commented Feb 5, 2020

Yes, it's a known issue:

For example, `cargo-udeps` cannot detect usage of crates that are only used in doc-tests.",

@nmattia
Copy link
Author

nmattia commented Feb 6, 2020

Thanks for the quick response! Anything we can do about it?

@est31
Copy link
Owner

est31 commented Feb 7, 2020

#4 could solve it. But it's a larger project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants