From ec6c5e35fab1bfe464abcb2a24eb92cab84a699d Mon Sep 17 00:00:00 2001 From: John Turner Date: Wed, 16 Nov 2022 21:11:10 -0500 Subject: [PATCH] override "TMPDIR" environment variable for all cargo commands Rustdoc does not respect "CARGO_TARGET_DIR" and instead uses "TMPDIR" or /tmp. On systems that mount /tmp with "noexec" this breaks doc tests, since they can't be executed. --- dir-locals/eglot-rust-dir-locals.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dir-locals/eglot-rust-dir-locals.el b/dir-locals/eglot-rust-dir-locals.el index 9fff9e8..5f7d0c6 100644 --- a/dir-locals/eglot-rust-dir-locals.el +++ b/dir-locals/eglot-rust-dir-locals.el @@ -3,4 +3,5 @@ (:command "clippy"))))) (rust-format-on-save . t) (rust-format-goto-problem . t) - (rust-rustfmt-switches . ("--edition" "2021"))))) + (rust-rustfmt-switches . ("--edition" "2021")))) + (nil . ((rust-cargo-bin . "TMPDIR=~/tmp cargo"))))