about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorEzra Shaw <ezrasure@outlook.com>2023-04-12 14:01:59 +1200
committerEzra Shaw <ezrasure@outlook.com>2023-04-12 14:01:59 +1200
commita159dcda6292c03faf3adb37f0a176ca7a35f0dc (patch)
tree2a1e1dc7a541e1fe73936a61652094d01a26b88c /src/bootstrap
parent1e95cddc74f88c1bb86f80103d0d7128f779f544 (diff)
downloadrust-a159dcda6292c03faf3adb37f0a176ca7a35f0dc.tar.gz
rust-a159dcda6292c03faf3adb37f0a176ca7a35f0dc.zip
fix: disable `x suggest` when using `build-metrics`
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/lib.rs2
-rw-r--r--src/bootstrap/suggest.rs8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 2ce9ddd2a68..1f2fa3df98e 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -190,7 +190,7 @@ pub enum GitRepo {
 /// although most functions are implemented as free functions rather than
 /// methods specifically on this structure itself (to make it easier to
 /// organize).
-#[derive(Clone)]
+#[cfg_attr(not(feature = "build-metrics"), derive(Clone))]
 pub struct Build {
     /// User-specified configuration from `config.toml`.
     config: Config,
diff --git a/src/bootstrap/suggest.rs b/src/bootstrap/suggest.rs
index 1a482e41659..ff20ebec267 100644
--- a/src/bootstrap/suggest.rs
+++ b/src/bootstrap/suggest.rs
@@ -1,3 +1,5 @@
+#![cfg_attr(feature = "build-metrics", allow(unused))]
+
 use std::str::FromStr;
 
 use std::path::PathBuf;
@@ -7,7 +9,13 @@ use crate::{
     tool::Tool,
 };
 
+#[cfg(feature = "build-metrics")]
+pub fn suggest(builder: &Builder<'_>, run: bool) {
+    panic!("`x suggest` is not supported with `build-metrics`")
+}
+
 /// Suggests a list of possible `x.py` commands to run based on modified files in branch.
+#[cfg(not(feature = "build-metrics"))]
 pub fn suggest(builder: &Builder<'_>, run: bool) {
     let suggestions =
         builder.tool_cmd(Tool::SuggestTests).output().expect("failed to run `suggest-tests` tool");