Skip to content

Fix path resolution of rustfmt in cargo-fmt #6566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

onur-ozkan
Copy link
Member

Instead of resolving rustfmt path from RUSTFMT or PATH envs, use the one located in the same directory as cargo-fmt. So that cargo-fmt uses the expected version of rustfmt to avoid accidental use of unrelated versions.

This shouldn't change anything on the current behavior but it should make it easier to test the bootstrapped cargo-fmt in rust-lang/rust, since it currently always points to the globally installed rustfmt.

Moved from rust-lang/rust#141100

Instead of resolving `rustfmt` path from RUSTFMT or PATH envs, use the one
located in the same directory as `cargo-fmt`. So that `cargo-fmt` uses the
expected version of `rustfmt` to avoid accidental use of unrelated versions.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants