Skip to content

cargo tree gives wrong suggestion with -i on ambiguous spec #12433

@tommy-gilligan

Description

@tommy-gilligan

Problem

% cargo tree -i time
error: There are multiple `time` packages in your project, and the specification `time` is ambiguous.
Please re-run this command with `-p <spec>` where `<spec>` is one of the following:
  time@0.1.45
  time@0.3.23

But I never used -p

Steps

  1. Have multiple versions of a spec
  2. Run cargo tree -i $SPEC_NAME without specifying version

Possible Solution(s)

  • Make message provide advice suitable for either -i or -p case
  • Make message reflect the case in which it is being used.
  • Remove advice message

Notes

No response

Version

% cargo version --verbose
cargo 1.71.0 (cfd3bbd8f 2023-06-08)
release: 1.71.0
commit-hash: cfd3bbd8fe4fd92074dfad04b7eb9a923646839f
commit-date: 2023-06-08
host: aarch64-apple-darwin
libgit2: 1.6.4 (sys:0.17.1 vendored)
libcurl: 8.1.2 (sys:0.4.61+curl-8.0.1 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 1.1.1t  7 Feb 2023
os: Mac OS 14.0.0 [64-bit]

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Error and warning messages generated by Cargo itself.C-bugCategory: bugCommand-treeS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions