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

False positive in tokio #31

Closed
mathstuf opened this issue Oct 14, 2019 · 3 comments · Fixed by #35
Closed

False positive in tokio #31

mathstuf opened this issue Oct 14, 2019 · 3 comments · Fixed by #35

Comments

@mathstuf
Copy link

On tokio-rs/tokio#1656 with the -Z minimum-versions and commenting out the build-tests crate, I get this false positive report:

unused dependencies:
`tokio-net v0.2.0-alpha.6 (/home/boeckb/code/depot/lang-rust/proj-tokio/tokio/src/tokio-net)`
└─── (dev-)dependencies
     └─── "tokio-net"

Or at least it appears to be a false positive since there's no tokio-net dependency in…itself (not even an older version).

Attaching the save-analysis directory generated from the run.

cargo-udeps-tokio-false-positive.tar.gz

@qryxip
Copy link
Collaborator

qryxip commented Oct 14, 2019

When a lib target is found, cargo-udeps regards it as a dependency because bins, tests, and examples should depend on it. The save-analysis does not seem to contain tests. (test-cat is a bin target)

Currently, you need to run with --all-targets to find dependencies that are not used by any target.

screenshot_000

@est31
Copy link
Owner

est31 commented Oct 14, 2019

@qryxip btw as you seem around a lot, I've added you as collaborator to the project

@qryxip
Copy link
Collaborator

qryxip commented Oct 22, 2019

When a lib target is found, cargo-udeps regards it as a dependency because bins, tests, and examples should depend on it. The save-analysis does not seem to contain tests. (test-cat is a bin target)

After thinking about it, this it not necessary. We want to find unused dependencies, not connected components of graphs.

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

Successfully merging a pull request may close this issue.

3 participants