diff options
author | Aleksey Kladov <[email protected]> | 2020-07-21 09:30:54 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-21 09:30:54 +0100 |
commit | a20b8d751bb59becb19c9edbb5e3f3ffe31bbcf3 (patch) | |
tree | 55be1108d5e71b6bf9a233a32cfef907007d60b2 /crates/flycheck/src | |
parent | 3432afcbd2fa69fe7da02506123a32baba083f7a (diff) |
Propagate cargo.target to checkOnSave
Diffstat (limited to 'crates/flycheck/src')
-rw-r--r-- | crates/flycheck/src/lib.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs index 6804d9bda..6e06adaa5 100644 --- a/crates/flycheck/src/lib.rs +++ b/crates/flycheck/src/lib.rs | |||
@@ -22,6 +22,7 @@ pub use cargo_metadata::diagnostic::{ | |||
22 | pub enum FlycheckConfig { | 22 | pub enum FlycheckConfig { |
23 | CargoCommand { | 23 | CargoCommand { |
24 | command: String, | 24 | command: String, |
25 | target_tripple: Option<String>, | ||
25 | all_targets: bool, | 26 | all_targets: bool, |
26 | all_features: bool, | 27 | all_features: bool, |
27 | features: Vec<String>, | 28 | features: Vec<String>, |
@@ -178,6 +179,7 @@ impl FlycheckActor { | |||
178 | let mut cmd = match &self.config { | 179 | let mut cmd = match &self.config { |
179 | FlycheckConfig::CargoCommand { | 180 | FlycheckConfig::CargoCommand { |
180 | command, | 181 | command, |
182 | target_tripple, | ||
181 | all_targets, | 183 | all_targets, |
182 | all_features, | 184 | all_features, |
183 | extra_args, | 185 | extra_args, |
@@ -187,6 +189,10 @@ impl FlycheckActor { | |||
187 | cmd.arg(command); | 189 | cmd.arg(command); |
188 | cmd.args(&["--workspace", "--message-format=json", "--manifest-path"]) | 190 | cmd.args(&["--workspace", "--message-format=json", "--manifest-path"]) |
189 | .arg(self.workspace_root.join("Cargo.toml")); | 191 | .arg(self.workspace_root.join("Cargo.toml")); |
192 | |||
193 | if let Some(target) = target_tripple { | ||
194 | cmd.args(&["--target", target.as_str()]); | ||
195 | } | ||
190 | if *all_targets { | 196 | if *all_targets { |
191 | cmd.arg("--all-targets"); | 197 | cmd.arg("--all-targets"); |
192 | } | 198 | } |