tidy: add build-metrics-gated feature status serialization
Co-authored-by: Jane Losare-Lusby <jlusby42@gmail.com>
This commit is contained in:
parent
57e8575760
commit
93563980a3
3 changed files with 7 additions and 0 deletions
|
|
@ -12,11 +12,15 @@ miropt-test-tools = { path = "../miropt-test-tools" }
|
|||
walkdir = "2"
|
||||
ignore = "0.4.18"
|
||||
semver = "1.0"
|
||||
serde = { version = "1.0.125", features = ["derive"], optional = true }
|
||||
termcolor = "1.1.3"
|
||||
rustc-hash = "2.0.0"
|
||||
fluent-syntax = "0.11.1"
|
||||
similar = "2.5.0"
|
||||
|
||||
[features]
|
||||
build-metrics = ["dep:serde"]
|
||||
|
||||
[[bin]]
|
||||
name = "rust-tidy"
|
||||
path = "src/main.rs"
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ const FEATURE_GROUP_START_PREFIX: &str = "// feature-group-start";
|
|||
const FEATURE_GROUP_END_PREFIX: &str = "// feature-group-end";
|
||||
|
||||
#[derive(Debug, PartialEq, Clone)]
|
||||
#[cfg_attr(feature = "build-metrics", derive(serde::Serialize))]
|
||||
pub enum Status {
|
||||
Accepted,
|
||||
Removed,
|
||||
|
|
@ -45,6 +46,7 @@ impl fmt::Display for Status {
|
|||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[cfg_attr(feature = "build-metrics", derive(serde::Serialize))]
|
||||
pub struct Feature {
|
||||
pub level: Status,
|
||||
pub since: Option<Version>,
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ mod tests;
|
|||
pub const VERSION_PLACEHOLDER: &str = "CURRENT_RUSTC_VERSION";
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[cfg_attr(feature = "build-metrics", derive(serde::Serialize))]
|
||||
pub enum Version {
|
||||
Explicit { parts: [u32; 3] },
|
||||
CurrentPlaceholder,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue