I am a multi-decade emacs user. I've working in Rust on and off since November 2020.
I put:
> /*
> * Local Variables:
> * mode: rust
> * compile-command: "cd .. && cargo build"
> * End:
> */
so that the compile key (for me, Alt+F12) runs cargo. All is well.
The cargo/rustc output looks like:
error[E0515]: cannot return value referencing local data `d1.child_socket`
--> src/dull.rs:102:16
so when I hit C-x ` to go from error to error, emacs goes to the file name just fine.
Where I get into trouble is that I sometimes omit the compile command, or I just run "cargo test",
which works, but now emacs is confused about the current directory, since it thinks I'm compile in "src", but cargo has gone up a directory. Emacs now queries me on each file to be sure I want to go there.
I'm wondering if there is something obvious I'm missing that would make this go away?