Skip to content

cargo update --precise without -p flag silently succeeds and runs cargo update #10919

Closed
@lopopolo

Description

@lopopolo

Problem

I tried to use cargo update with the --precise flag to downgrade a dependency without reading the docs.

I tried:

$ cargo update --precise [email protected]
    Updating crates.io index

This succeeded with no error and did not do what I expected.

The docs mention that --precise is meant to be combined with the -p flag:

When used with -p, allows you to specify a specific version number to set the package to. If the package comes from a git repository, this can be a git revision (such as a SHA hash or tag).

Steps

run cargo update --precise [email protected]

Possible Solution(s)

The docs mention that --precise is meant to be combined with the -p flag. If --precise is given without -p, I think this should be an error.

Notes

No response

Version

cargo 1.62.1 (a748cf5a3 2022-06-08)
release: 1.62.1
commit-hash: a748cf5a3e666bc2dcdf54f37adef8ef22196452
commit-date: 2022-06-08
host: x86_64-apple-darwin
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.79.1 (sys:0.4.51+curl-7.80.0 system ssl:(SecureTransport) LibreSSL/3.3.6)
os: Mac OS 12.5.0 [64-bit]

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Error and warning messages generated by Cargo itself.C-bugCategory: bugCommand-updateE-easyExperience: Easy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions