From d3b804d11d554e6d4e4ccbad92add86e093b4bdb Mon Sep 17 00:00:00 2001
From: Jonas Schievink <jonasschievink@gmail.com>
Date: Mon, 5 Apr 2021 00:33:11 +0200
Subject: [PATCH] Error when `rustfmt` component is unavailable

---
 crates/rust-analyzer/src/handlers.rs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs
index 53d29ddfc62..e8f9f21794e 100644
--- a/crates/rust-analyzer/src/handlers.rs
+++ b/crates/rust-analyzer/src/handlers.rs
@@ -928,7 +928,10 @@ pub(crate) fn handle_formatting(
 
     if !output.status.success() {
         match output.status.code() {
-            Some(1) if !captured_stderr.contains("not installed") => {
+            Some(1)
+                if !captured_stderr.contains("not installed")
+                    && !captured_stderr.contains("not available") =>
+            {
                 // While `rustfmt` doesn't have a specific exit code for parse errors this is the
                 // likely cause exiting with 1. Most Language Servers swallow parse errors on
                 // formatting because otherwise an error is surfaced to the user on top of the