Closed RArbore closed 2 years ago
I've never seens this but seems to be a flycheck issue. You don't want to use lsp with flycheck ?
I'm not quite sure I know what you mean - are you saying I shouldn't use lsp w/ flycheck?
My rust emacs config worked last time I used it on an old OS installation. Recently, I reinstalled and now I'm getting the above errors. Here is the relevant portion of my emacs config:
;; Rust mode
(use-package rust-mode
:ensure t
:mode "\\.rs\\'"
:config (setq rust-format-on-save t)
)
(use-package cargo
:ensure t
:init
(add-hook 'rust-mode-hook 'cargo-minor-mode)
(add-hook 'toml-mode-hook 'cargo-minor-mode)
)
(use-package flycheck-rust
:ensure t)
(add-hook 'rust-mode-hook
(lambda () (setq indent-tabs-mode nil)))
(setq rust-format-on-save t)
(with-eval-after-load 'rust-mode
(add-hook 'flycheck-mode-hook #'flycheck-rust-setup))
Also, if I run cargo run
in my terminal in my project, it works fine. However, if I use projectile to run cargo run
, it complains that error: no override and no default toolchain set
. Could this be some emacs issue regarding not getting environment variables from .bashrc?
Turned out that was the issue - for those wondering, I used exec-path-from-shell
in order to fix this, as I set my RUSTUP_HOME and CARGO_HOME environment variables to non-default values.
It looked like it was related to flycheck. But good to know that you fixed it by using exec-path-from-shell
.
Hello - I recently reinstalled emacs and rustup on my machine, and I'm getting the above error whenever I open a .rs file.
I installed rust via rustup in the Arch repositories. I've also tried using the rustup script from the rustup.rs website, but I get the above error with both.
When running
rustup default
, I get...stable-x86_64-unknown-linux-gnu (default)
This is the full error from emacs:
Tried searching around, but couldn't find anything about this. Any help would be appreciated.