Skip to content

Commit a159dcd

Browse files
committed
fix: disable x suggest when using build-metrics
1 parent 1e95cdd commit a159dcd

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/bootstrap/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ pub enum GitRepo {
190190
/// although most functions are implemented as free functions rather than
191191
/// methods specifically on this structure itself (to make it easier to
192192
/// organize).
193-
#[derive(Clone)]
193+
#[cfg_attr(not(feature = "build-metrics"), derive(Clone))]
194194
pub struct Build {
195195
/// User-specified configuration from `config.toml`.
196196
config: Config,

src/bootstrap/suggest.rs

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg_attr(feature = "build-metrics", allow(unused))]
2+
13
use std::str::FromStr;
24

35
use std::path::PathBuf;
@@ -7,7 +9,13 @@ use crate::{
79
tool::Tool,
810
};
911

12+
#[cfg(feature = "build-metrics")]
13+
pub fn suggest(builder: &Builder<'_>, run: bool) {
14+
panic!("`x suggest` is not supported with `build-metrics`")
15+
}
16+
1017
/// Suggests a list of possible `x.py` commands to run based on modified files in branch.
18+
#[cfg(not(feature = "build-metrics"))]
1119
pub fn suggest(builder: &Builder<'_>, run: bool) {
1220
let suggestions =
1321
builder.tool_cmd(Tool::SuggestTests).output().expect("failed to run `suggest-tests` tool");

0 commit comments

Comments
 (0)