Skip to content

cargo rustc --version should print the version of rustc called by cargo #13611

Open
@lolbinarycat

Description

@lolbinarycat

Problem

it is difficult to check if the version of rustc called by cargo and the version of rustc in the users environment are the same, either due to RUSTC or RUSTC_WRAPPER being set, or due to cargo being patched by a package manager such as nix.

Proposed Solution

when cargo rustc --version is run, cargo should invoke rustc --version following all the usual rules of how to find rustc, such as checking RUSTC and RUSTC_WRAPPER

Notes

you an kind of get the desired effect with RUSTFLAGS=--version, but it's a bit of a hack.

`cargo rustc -- --version also doesn't exist for some reason.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-rustcS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions