diff --git a/crates/rust-analyzer/src/cli/flags.rs b/crates/rust-analyzer/src/cli/flags.rs index 3f68c5d053b..b3b8ab9a404 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, } diff --git a/xtask/src/flags.rs b/xtask/src/flags.rs index f7ae0eb1b42..54025b74074 100644 --- a/xtask/src/flags.rs +++ b/xtask/src/flags.rs @@ -81,35 +81,6 @@ pub enum XtaskCmd { Codegen(Codegen), } -#[derive(Debug)] -pub struct Codegen { - pub check: bool, - pub codegen_type: Option, -} - -#[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 { - 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, @@ -145,6 +116,65 @@ pub struct PublishReleaseNotes { pub dry_run: bool, } +#[derive(Debug)] +pub struct Metrics { + pub measurement_type: Option, +} + +#[derive(Debug)] +pub struct Bb { + pub suffix: String, +} + +#[derive(Debug)] +pub struct Codegen { + pub codegen_type: Option, + + 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::from_env_() + } + + #[allow(dead_code)] + pub fn from_vec(args: Vec) -> xflags::Result { + 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 { + 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, @@ -185,34 +215,6 @@ impl AsRef for MeasurementType { } } -#[derive(Debug)] -pub struct Metrics { - pub measurement_type: Option, -} - -#[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::from_env_() - } - - #[allow(dead_code)] - pub fn from_vec(args: Vec) -> xflags::Result { - Self::from_vec_(args) - } -} -// generated end - impl Install { pub(crate) fn server(&self) -> Option { if self.client && !self.server {