Fix deduplication in cargo tree (fixes #9599)#16606
Fix deduplication in cargo tree (fixes #9599)#16606Nutomic wants to merge 2 commits intorust-lang:masterfrom
Conversation
|
r? @epage rustbot has assigned @epage. Use Why was this reviewer chosen?The reviewer was selected based on:
|
There was a problem hiding this comment.
FWIW, for bugfixes, we usually follow a variant of atomic commit pattern:
- Commit a test that asserts the current buggy behavior (passes).
- In the next commit, fix the bug and update the test/snapshot.
Every commit passes, and the test/snapshot diff shows the behavior change.
There was a problem hiding this comment.
Not sure I understand. The test in this file already asserts the current behaviour and passes. Do you simply want me to squash the two commits in this PR into one?
There was a problem hiding this comment.
Any changes to the test (like adding optdep 2.0.0), should be made in the first commit.
The 2nd commit should then only show the impact caused by the bug fix to the test (only the stdout_data should change).
a15b94a to
fd93d89
Compare
What does this PR try to resolve?
cargo tree --duplicateswrongly shows the same crate version multiple times if it is used with different features, or as both normal dependency and dev dependency. #9599 has more details.How to test and review this PR?
Ran the code as
cargo run -- tree --manifest-path /path/to/Cargo.toml -dand compared the output to stable cargo.