From ddce6bb282764692d53b719bff4c37e3512d4556 Mon Sep 17 00:00:00 2001 From: Daniel McNab <36049421+DJMcNab@users.noreply.github.com> Date: Mon, 8 Mar 2021 09:05:19 +0000 Subject: Support disabling rustc build scripts --- crates/project_model/src/workspace.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'crates/project_model') diff --git a/crates/project_model/src/workspace.rs b/crates/project_model/src/workspace.rs index ea0c9ff60..d754c8b55 100644 --- a/crates/project_model/src/workspace.rs +++ b/crates/project_model/src/workspace.rs @@ -56,6 +56,7 @@ impl fmt::Debug for ProjectWorkspace { match self { ProjectWorkspace::Cargo { cargo, sysroot, rustc, rustc_cfg } => f .debug_struct("Cargo") + .field("root", &cargo.workspace_root()) .field("n_packages", &cargo.packages().len()) .field("n_sysroot_crates", &sysroot.crates().len()) .field( @@ -273,12 +274,19 @@ impl ProjectWorkspace { crate_graph } - pub fn collect_build_data_configs(&self, collector: &mut BuildDataCollector) { + pub fn collect_build_data_configs( + &self, + collector: &mut BuildDataCollector, + for_private: bool, + ) { match self { ProjectWorkspace::Cargo { cargo, rustc, .. } => { collector.add_config(&cargo.workspace_root(), cargo.build_data_config().clone()); - if let Some(rustc) = rustc { - collector.add_config(rustc.workspace_root(), rustc.build_data_config().clone()); + if for_private { + if let Some(rustc) = rustc { + collector + .add_config(rustc.workspace_root(), rustc.build_data_config().clone()); + } } } _ => {} -- cgit v1.2.3