I'm currently struggling to set up error checking for rust in emacs. Flycheck seems to work fine with other languages (C, Python, Ruby, eLisp) but doesn't appear to do anything in rust-mode.
I haven't noticed any error messages, but when I run flycheck-verify-setup, I get the following:
Syntax checkers for buffer state.rs in rust-mode:
rust-cargo
- predicate: nil
- executable: Not found
rust
- predicate: nil
- executable: Not found
Flycheck Mode is enabled. Use C-u C-c ! x to enable disabled
checkers.
I tried manually setting the executable but wasn't sure about the predicate, and was concerned that I'd be interfering with flycheck-rust-setup.
The current configuration code I have written concerning this is:
(setq exec-path (append exec-path '("/Users/jac32/.cargo/bin")))
(add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode))
;; Set path to racer binary
(setq racer-cmd "/usr/local/bin/racer")
;; Set path to rust src directory
(setq racer-rust-src-path "/Users/jac32/.rust/src/")
(add-hook 'rust-mode-hook #'racer-mode)
(add-hook 'racer-mode-hook #'eldoc-mode)
(add-hook 'rust-mode-hook
(lambda ()
(setq flycheck-mode-hook #'flycheck-rust-setup)))
And my current setup loads all of the following packages:
(defvar required-packages
'(
base16-theme
company
company-racer
evil
flycheck
flycheck-rust
helm
magit
rainbow-delimiters
rust-mode
racer
yasnippet
) "a list of packages to ensure are installed at launch.")
Thank you for any and all help on this issue.
update Just discovered that the rustc and cargo executables were not located anywhere within the exec-path variable. Under flycheck-verify-setup, both checker executables are found and the predicate for rust-cargo is t. However, resetting flycheck-mode now causes the following message to appear:
Suspicious state from syntax checker rust-cargo: Checker rust-cargo
returned non-zero exit code 101, but no errors from output: Could not
execute process `rustc -vV` (never executed)
Caused by:
No such file or directory (os error 2)