Skip to content
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

cargo fix applies fixes multiple times on files imported multiple times #57171

Closed
Marwes opened this issue Dec 28, 2018 · 2 comments
Closed

cargo fix applies fixes multiple times on files imported multiple times #57171

Marwes opened this issue Dec 28, 2018 · 2 comments
Labels
T-cargo Relevant to the cargo team, which will review and decide on the PR/issue.

Comments

@Marwes
Copy link
Contributor

Marwes commented Dec 28, 2018

cargo fix appears to try and apply its fixes multiple times if a file is used multiple times. This can be a problem when using "support" modules for tests as cargo fix can end up calculating the locations for the fixes on the original file for two test, apply them for the first test and then apply them for the second test, only the file has now changed and the fix gets applied in the wrong location. (At least that is what appears to happen).

tests/
    a.rs
    b.rs
    support/mod.rs # Used by a.rs and b.rs

Workaround is to specify --jobs 1 when running cargo fix

@ehuss
Copy link
Contributor

ehuss commented Dec 28, 2018

This should be fixed by rust-lang/cargo#6434 which will hit nightly once #56924 lands.

@Centril Centril added the T-cargo Relevant to the cargo team, which will review and decide on the PR/issue. label Dec 29, 2018
@jonas-schievink
Copy link
Contributor

#56924 has been merged, closing this. @Marwes if this is still an issue, please leave a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-cargo Relevant to the cargo team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants