From cdf8ea7453d906740334af4d85a71cc8dd27210d Mon Sep 17 00:00:00 2001 From: Robert Bartlensky Date: Sat, 10 Jul 2021 21:14:24 +0100 Subject: [PATCH] Error when nightly toolchain is not available. --- rustic-rustfmt.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rustic-rustfmt.el b/rustic-rustfmt.el index 6e9e34a5..c461fe2f 100644 --- a/rustic-rustfmt.el +++ b/rustic-rustfmt.el @@ -209,6 +209,8 @@ This operation requires a nightly version of rustfmt. (if (not (region-active-p)) (rustic-format-buffer) (let* ((buf (current-buffer)) (file (buffer-file-name buf))) + (unless (equal (call-process "cargo" nil nil nil "+nightly") 0) + (error "Need nightly toolchain to format region.")) (let ((start (+ 1 (count-lines 1 begin))) (len (- (count-lines begin end) 1))) (rustic-compilation-process-live t)