Skip to content

Commit

Permalink
Merge pull request flycheck#1831 from cwyang/master
Browse files Browse the repository at this point in the history
FIX: flycheck-rust processes an error record with nil code
  • Loading branch information
fmdkdd authored Oct 23, 2020
2 parents cd8e0a2 + ea0646c commit 7df7f61
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions flycheck.el
Original file line number Diff line number Diff line change
Expand Up @@ -7222,9 +7222,10 @@ machine_message.rs at URL `https://git.io/vh24R'."
;; Errors and warnings from rustc are wrapped by cargo, so we filter and
;; unwrap them, and delegate the actual construction of `flycheck-error'
;; objects to `flycheck-parse-rustc-diagnostic'.
;; Check whether the code is non-nil because Rust≥1.44 includes the
;; warning count upon completion.
(when (and .message.code (string= .reason "compiler-message"))
;; We put the error record with nil code since flycheck regards
;; the case of nonzero return code without any error report
;; as abnormal result.
(when (string= .reason "compiler-message")
(push (flycheck-parse-rustc-diagnostic .message checker buffer)
errors))))
(apply #'nconc errors)))
Expand Down

0 comments on commit 7df7f61

Please sign in to comment.