aboutsummaryrefslogtreecommitdiff
path: root/crates/flycheck
diff options
context:
space:
mode:
Diffstat (limited to 'crates/flycheck')
-rw-r--r--crates/flycheck/Cargo.toml1
-rw-r--r--crates/flycheck/src/lib.rs9
2 files changed, 9 insertions, 1 deletions
diff --git a/crates/flycheck/Cargo.toml b/crates/flycheck/Cargo.toml
index dc26b8ce7..bea485694 100644
--- a/crates/flycheck/Cargo.toml
+++ b/crates/flycheck/Cargo.toml
@@ -3,6 +3,7 @@ edition = "2018"
3name = "flycheck" 3name = "flycheck"
4version = "0.1.0" 4version = "0.1.0"
5authors = ["rust-analyzer developers"] 5authors = ["rust-analyzer developers"]
6license = "MIT OR Apache-2.0"
6 7
7[lib] 8[lib]
8doctest = false 9doctest = false
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 }