Closed romatthe closed 3 years ago
Cannot reproduce. Diagnostics in the bat
crate work fine here. Maybe something wrong in your flycheck-rust
setup? This is the part that detects binary/library targets. What does M-: (flycheck-rust-find-cargo-target buffer-file-name)
returns in a bat
file? I get:
((kind . "bin") (name . "bat"))
Sorry for the delay, haven't been able to get back to the system where I'm having the issue. I will get back to you as soon as possible.
I can confirm that this happens on a newly created cargo project.
$ cargo new --bin rlisp
Created binary (application) `rlisp` package
After editing src/main.rs
and saving the file I get the original error message about suspicious state.
M-: (flycheck-rust-find-cargo-target buffer-file-name)
results in ((kind . "bin") (name . "rlisp"))
Running flycheck-verify-setup
originally showed similar output to what @romatthe observed. After running flycheck-rust-setup
, the output of flycheck-verify-setup
was correct and the error about a suspicious state went away.
After running flycheck-rust-setup,
@peschkaj Ah, yes, flycheck-rust-setup
needs to be run on each Rust buffer, otherwise flycheck
alone does not know which crate type it should check for. That's why we recommend putting flycheck-rust-setup
in a hook in the README.
Hi,
The issue I'm opening here has been discussed in other issues, so I apologize if this is a duplicate, but I haven't been able to find a solution.
I'm trying to set up Emacs to work with Rust and Flycheck, but the
rust-cargo
checker keeps on crashing on me with the following error when running it against a simple but popular Rust repo,bat
:I did the usual stuff:
flycheck-verify-setup
:The report of
rust-cargo
is a little strange, becausebat
is acat
clone, so it's a--bin
crate, not a--lib
crate.C-c ! C-c rust-cargo <RET>
:So it makes sense that the compilation commands fails, as there is no
--lib
target.I tried to find out how
flycheck.el
orflycheck-rust.el
determines the Crate type, but my elisp is terrible and I not very good at debugging Emacs.Is this a problem with the setup of the
bat
Cargo.toml or with flycheck-rust?Emacs version:
Cargo version:
Flycheck version: git 47174a1
(Again, apologies if this a duplicate issue, I'm both a Rust and Emacs newbie)