Unnamed repository; edit this file 'description' to name the repository.
Move xtask flags around outide the generated section
| -rw-r--r-- | crates/rust-analyzer/src/cli/flags.rs | 1 | ||||
| -rw-r--r-- | xtask/src/flags.rs | 116 |
2 files changed, 60 insertions, 57 deletions
diff --git a/crates/rust-analyzer/src/cli/flags.rs b/crates/rust-analyzer/src/cli/flags.rs index 3f68c5d053..b3b8ab9a40 100644 --- a/crates/rust-analyzer/src/cli/flags.rs +++ b/crates/rust-analyzer/src/cli/flags.rs @@ -235,6 +235,7 @@ pub struct RunTests { #[derive(Debug)] pub struct RustcTests { pub rustc_repo: PathBuf, + pub filter: Option<String>, } diff --git a/xtask/src/flags.rs b/xtask/src/flags.rs index f7ae0eb1b4..54025b7407 100644 --- a/xtask/src/flags.rs +++ b/xtask/src/flags.rs @@ -82,35 +82,6 @@ pub enum XtaskCmd { } #[derive(Debug)] -pub struct Codegen { - pub check: bool, - pub codegen_type: Option<CodegenType>, -} - -#[derive(Debug, Default)] -pub enum CodegenType { - #[default] - All, - Grammar, - AssistsDocTests, - DiagnosticsDocs, - LintDefinitions, -} - -impl FromStr for CodegenType { - type Err = String; - fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "all" => Ok(Self::All), - "grammar" => Ok(Self::Grammar), - "assists-doc-tests" => Ok(Self::AssistsDocTests), - "diagnostics-docs" => Ok(Self::DiagnosticsDocs), - "lints-definitions" => Ok(Self::LintDefinitions), - _ => Err("Invalid option".to_owned()), - } - } -} -#[derive(Debug)] pub struct Install { pub client: bool, pub code_bin: Option<String>, @@ -146,6 +117,65 @@ pub struct PublishReleaseNotes { } #[derive(Debug)] +pub struct Metrics { + pub measurement_type: Option<MeasurementType>, +} + +#[derive(Debug)] +pub struct Bb { + pub suffix: String, +} + +#[derive(Debug)] +pub struct Codegen { + pub codegen_type: Option<CodegenType>, + + pub check: bool, +} + +impl Xtask { + #[allow(dead_code)] + pub fn from_env_or_exit() -> Self { + Self::from_env_or_exit_() + } + + #[allow(dead_code)] + pub fn from_env() -> xflags::Result<Self> { + Self::from_env_() + } + + #[allow(dead_code)] + pub fn from_vec(args: Vec<std::ffi::OsString>) -> xflags::Result<Self> { + Self::from_vec_(args) + } +} +// generated end + +#[derive(Debug, Default)] +pub enum CodegenType { + #[default] + All, + Grammar, + AssistsDocTests, + DiagnosticsDocs, + LintDefinitions, +} + +impl FromStr for CodegenType { + type Err = String; + fn from_str(s: &str) -> Result<Self, Self::Err> { + match s { + "all" => Ok(Self::All), + "grammar" => Ok(Self::Grammar), + "assists-doc-tests" => Ok(Self::AssistsDocTests), + "diagnostics-docs" => Ok(Self::DiagnosticsDocs), + "lints-definitions" => Ok(Self::LintDefinitions), + _ => Err("Invalid option".to_owned()), + } + } +} + +#[derive(Debug)] pub enum MeasurementType { Build, RustcTests, @@ -185,34 +215,6 @@ impl AsRef<str> for MeasurementType { } } -#[derive(Debug)] -pub struct Metrics { - pub measurement_type: Option<MeasurementType>, -} - -#[derive(Debug)] -pub struct Bb { - pub suffix: String, -} - -impl Xtask { - #[allow(dead_code)] - pub fn from_env_or_exit() -> Self { - Self::from_env_or_exit_() - } - - #[allow(dead_code)] - pub fn from_env() -> xflags::Result<Self> { - Self::from_env_() - } - - #[allow(dead_code)] - pub fn from_vec(args: Vec<std::ffi::OsString>) -> xflags::Result<Self> { - Self::from_vec_(args) - } -} -// generated end - impl Install { pub(crate) fn server(&self) -> Option<ServerOpt> { if self.client && !self.server { |