mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Move xtask flags around outide the generated section
This commit is contained in:
parent
e265e3d518
commit
84d38c7e94
2 changed files with 60 additions and 57 deletions
|
@ -235,6 +235,7 @@ pub struct RunTests {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct RustcTests {
|
pub struct RustcTests {
|
||||||
pub rustc_repo: PathBuf,
|
pub rustc_repo: PathBuf,
|
||||||
|
|
||||||
pub filter: Option<String>,
|
pub filter: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,35 +81,6 @@ pub enum XtaskCmd {
|
||||||
Codegen(Codegen),
|
Codegen(Codegen),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[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)]
|
#[derive(Debug)]
|
||||||
pub struct Install {
|
pub struct Install {
|
||||||
pub client: bool,
|
pub client: bool,
|
||||||
|
@ -145,6 +116,65 @@ pub struct PublishReleaseNotes {
|
||||||
pub dry_run: bool,
|
pub dry_run: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[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)]
|
#[derive(Debug)]
|
||||||
pub enum MeasurementType {
|
pub enum MeasurementType {
|
||||||
Build,
|
Build,
|
||||||
|
@ -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 {
|
impl Install {
|
||||||
pub(crate) fn server(&self) -> Option<ServerOpt> {
|
pub(crate) fn server(&self) -> Option<ServerOpt> {
|
||||||
if self.client && !self.server {
|
if self.client && !self.server {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue