Skip to content

Commit

Permalink
fix: disable x suggest when using build-metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezrashaw committed Apr 12, 2023
1 parent 1e95cdd commit a159dcd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions src/bootstrap/suggest.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg_attr(feature = "build-metrics", allow(unused))]

use std::str::FromStr;

use std::path::PathBuf;
Expand All @@ -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");
Expand Down

0 comments on commit a159dcd

Please sign in to comment.