Skip to content

cargo --locked clippy behaves differently than cargo clippy --locked #11390

@embe-pw

Description

@embe-pw

Problem

It seems that cargo --locked clippy is equivalent to cargo clippy (without the --locked flag) and not cargo clippy --locked, which is very confusing.

Steps

  1. cargo init foo
  2. cd foo
  3. cargo clippy --locked fails (correctly, as there is no Cargo.lock)
  4. cargo --locked clippy succeeds and creates Cargo.lock (incorrectly)

Possible Solution(s)

No response

Notes

(also checked on 2022-11-14 nightly)

Version

$ cargo version --verbose
cargo 1.65.0 (4bc8f24d3 2022-10-20)
release: 1.65.0
commit-hash: 4bc8f24d3e899462e43621aab981f6383a370365
commit-date: 2022-10-20
host: x86_64-unknown-linux-gnu
libgit2: 1.5.0 (sys:0.15.0 vendored)
libcurl: 7.83.1-DEV (sys:0.4.55+curl-7.83.1 vendored ssl:OpenSSL/1.1.1q)
os: CentOS 9.0.0 [64-bit]
$ cargo +nightly version --verbose
cargo 1.67.0-nightly (16b097879 2022-11-14)
release: 1.67.0-nightly
commit-hash: 16b097879b6f117c8ae698aab054c87f26ff325e
commit-date: 2022-11-14
host: x86_64-unknown-linux-gnu
libgit2: 1.5.0 (sys:0.15.0 vendored)
libcurl: 7.86.0-DEV (sys:0.4.59+curl-7.86.0 vendored ssl:OpenSSL/1.1.1q)
os: CentOS 9.0.0 [64-bit]

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cliArea: Command-line interface, option parsing, etc.A-custom-subcommandsArea: custom 3rd party subcommand pluginsC-bugCategory: bugS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions