Skip to content

Commit 75c4e03

Browse files
committed
Pass --format-version 1 to cargo metadata
cargo 0.19.0-nightly otherwise complains to stderr: warning: please specify `--format-version` flag explicitly to avoid compatibility problems We should heed this warning. Additionally, since we tell call-process to mix stdout and stderr into the same buffer, this warning’s presence was confusing json-read. Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 2c2dc64 commit 75c4e03

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

flycheck-rust.el

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ root of the file hierarchy."
8080
8181
MANIFEST is the path to the Cargo.toml file of the project.
8282
83-
Calls `cargo metadata --no-deps --manifest MANIFEST', parses and
84-
collects the targets for the current workspace, and returns them
85-
in a list, or nil if no targets could be found."
83+
Calls `cargo metadata --no-deps --manifest-path MANIFEST
84+
--format-version 1', parses and collects the targets for the
85+
current workspace, and returns them in a list, or nil if no
86+
targets could be found."
8687
(let ((cargo (funcall flycheck-executable-find "cargo")))
8788
(unless cargo
8889
(user-error "flycheck-rust cannot find `cargo'. Please \
@@ -95,7 +96,8 @@ more information on setting your PATH with Emacs."))
9596
(with-temp-buffer
9697
(call-process cargo nil t nil
9798
"metadata" "--no-deps"
98-
"--manifest-path" manifest)
99+
"--manifest-path" manifest
100+
"--format-version" "1")
99101
(goto-char (point-min))
100102
(let ((json-array-type 'list))
101103
(json-read)))

0 commit comments

Comments
 (0)