rust-lang / rust-mode

Emacs configuration for Rust
Apache License 2.0
1.1k stars 178 forks source link

Fix stdin issue for rust--format-fix-rustfmt-buffer. #367

Closed mookid closed 4 years ago

mookid commented 4 years ago

fix #365 The issue seems to be that in case of whitespace issues, rustfmt emits the message

error[internal]: left behind trailing whitespace
  --> stdin:13:13:0
   |
13 |                 
   | ^^^^^^^^^^^^^^^^
   |

warning: rustfmt has failed to format. See previous 1 errors.

and the replacement code that looks for ":" fails to replace the reference. As a consequence, the code that jumps to the error pops a new buffer, which is wrong.

cc @xaon @Dushistov

rust-highfive commented 4 years ago

r? @brotzeit

(rust_highfive has picked a reviewer for you, use r? to override)