cargo fmt
does not handle workspace member "Cargo.toml" being a symlink; gives error "Failed to find targets"
#6184
Labels
Problem
If a cargo workspace has a member project whose
Cargo.toml
is a symlink to a validCargo.toml
, then runningcargo fmt
from the member directory fails with:Here's a diff with a simple workspace that reproduces the issue.
You can
git apply
in an empty Git repo:Steps
Cargo.toml
to a symlinkcd
into member project directory from previous stepcargo fmt
Notes
Interestingly, even if all of the
Cargo.toml
files are symlinks, the issue does not occur when runningcargo fmt
from the root of the workspace.Version
This occurs on the latest stable and nightly versions of
rustfmt
as of submitting:(Migrated from rust-lang/cargo#14012 since
cargo-fmt
lives in rust repo, not cargo repo)The text was updated successfully, but these errors were encountered: