aboutsummaryrefslogtreecommitdiff
path: root/crates/flycheck/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/flycheck/src')
-rw-r--r--crates/flycheck/src/lib.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs
index 844b093d4..ad376ad18 100644
--- a/crates/flycheck/src/lib.rs
+++ b/crates/flycheck/src/lib.rs
@@ -14,13 +14,15 @@ use std::{
14use crossbeam_channel::{never, select, unbounded, Receiver, Sender}; 14use crossbeam_channel::{never, select, unbounded, Receiver, Sender};
15 15
16pub use cargo_metadata::diagnostic::{ 16pub use cargo_metadata::diagnostic::{
17 Applicability, Diagnostic, DiagnosticLevel, DiagnosticSpan, DiagnosticSpanMacroExpansion, 17 Applicability, Diagnostic, DiagnosticCode, DiagnosticLevel, DiagnosticSpan,
18 DiagnosticSpanMacroExpansion,
18}; 19};
19 20
20#[derive(Clone, Debug, PartialEq, Eq)] 21#[derive(Clone, Debug, PartialEq, Eq)]
21pub enum FlycheckConfig { 22pub enum FlycheckConfig {
22 CargoCommand { 23 CargoCommand {
23 command: String, 24 command: String,
25 target_triple: Option<String>,
24 all_targets: bool, 26 all_targets: bool,
25 all_features: bool, 27 all_features: bool,
26 features: Vec<String>, 28 features: Vec<String>,
@@ -177,6 +179,7 @@ impl FlycheckActor {
177 let mut cmd = match &self.config { 179 let mut cmd = match &self.config {
178 FlycheckConfig::CargoCommand { 180 FlycheckConfig::CargoCommand {
179 command, 181 command,
182 target_triple,
180 all_targets, 183 all_targets,
181 all_features, 184 all_features,
182 extra_args, 185 extra_args,
@@ -186,6 +189,10 @@ impl FlycheckActor {
186 cmd.arg(command); 189 cmd.arg(command);
187 cmd.args(&["--workspace", "--message-format=json", "--manifest-path"]) 190 cmd.args(&["--workspace", "--message-format=json", "--manifest-path"])
188 .arg(self.workspace_root.join("Cargo.toml")); 191 .arg(self.workspace_root.join("Cargo.toml"));
192
193 if let Some(target) = target_triple {
194 cmd.args(&["--target", target.as_str()]);
195 }
189 if *all_targets { 196 if *all_targets {
190 cmd.arg("--all-targets"); 197 cmd.arg("--all-targets");
191 } 198 }