rustfix
rustfix copied to clipboard
Automatically apply the suggestions made by rustc
```console $ cat src/lib.rs extern "C" { fn xsave64(p: *mut u8, hi: u32, lo: u32) -> /* comment */ (); } $ cargo +nightly clippy --fix -Z unstable-options $ git...
The suggestion original line snippets are missing the first character on multiline fixes. For example, a clippy warning about a redundant return at https://github.com/facebookexperimental/eden/blob/139717db04a9a28fca7f3d81553275198bbbb8a1/eden/mononoke/sshrelay/src/lib.rs#L165 shows a fix with the original...
In an empty directory, run: ```sh cargo new --lib a cargo new --lib b cargo new --lib a/c echo 'b = {path = "../b"}' >> a/Cargo.toml echo 'c = {path...
In the same spirit as the following environment variable https://github.com/rust-lang/cargo/blob/dc83ead224d8622f748f507574e1448a28d8dcc7/src/cargo/ops/fix.rs#L419 `cargo fix` could try first applying all suggestions _and if it fails_ applying only the `MachineApplicable` ones. This could be...
Work for #141 and rust-lang/rust#53934. **Don't merge this yet**; we need to evaluate downstream consequences
Here: https://github.com/rust-lang-nursery/rustfix/blob/89217428c130b62c7ddaa0734eb4ebaa33673a86/src/lib.rs#L191-L198 This issue concerns the matter of a single suggestion that happens to replace multiple spans (functionality that is not used _often_, but which [does exist](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/struct.Diagnostic.html#method.multipart_suggestion)). This is not...
https://blog.rust-lang.org/2018/10/30/help-test-rust-2018.html > The first step is to run `cargo fix`: > > ``` > $ cargo fix --edition > ``` > > This will check your code, and automatically fix...
Is something like `--dry-run` planned? Or rustfix will always require a VCS?
A place for people to report success (or partial success) and things they liked.