   ;; This uses position in *rustfmt* buffer to know which is the next
   ;; error to jump to, and source: line in the buffer to figure which
   ;; buffer it is from.
-  (let ((rustfmt (get-buffer "*rustfmt*")))
+  (let ((rustfmt (get-buffer rust-rustfmt-buffername)))
     (if (not rustfmt)
         (message "No *rustfmt*, no problems.")
       (let ((target-buffer (with-current-buffer rustfmt

;; Since we run rustfmt through stdin we get <stdin> markers in the
;; output. This replaces them with the buffer name instead.
(defun rust--format-fix-rustfmt-buffer (buffer-name)
  (with-current-buffer (get-buffer "*rustfmt*")
    (goto-char (point-min))
    (while (re-search-forward "--> <stdin>:")
      (replace-match (format "--> %s:" buffer-name)))))

  (when rust-format-on-save
    (if (not (executable-find rust-rustfmt-bin))
        (error "Could not locate executable \"%s\"" rust-rustfmt-bin)
      (when (get-buffer rust-rustfmt-buffername)
        ;; KLDUGE: re-run the error handlers -- otherwise message area
        ;; would show "Wrote ..." instead of the error description.
        (or (rust--format-error-handler)
