branch: elpa/flycheck
commit befd26a905b43f9663e990f7e7173561a11e9377
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Fix rust checker temp directory error on modern Rust
Since Rust 1.64.0, rustc tries to create temp files in the same
directory as the -o target, which fails when using -o /dev/null.
Switch to --emit=metadata --out-dir <temp-dir> which also works
on Windows where /dev/null doesn't exist.
Fixes #2043
---
flycheck.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/flycheck.el b/flycheck.el
index 32f162e875..7a2d4534ee 100644
--- a/flycheck.el
+++ b/flycheck.el
@@ -12180,7 +12180,8 @@ This syntax checker needs Rust 1.18 or newer. See URL
`https://www.rust-lang.org'."
:command ("rustc"
(option "--crate-type" flycheck-rust-crate-type)
- "--emit=mir" "-o" "/dev/null" ; avoid creating binaries
+ "--emit=metadata"
+ "--out-dir" (eval (flycheck-temp-dir-system)) ; avoid creating
binaries
"--error-format=json"
(option-flag "--test" flycheck-rust-check-tests)
(option-list "-L" flycheck-rust-library-path concat)