Skip to content

Commit 596c068

Browse files
committed
chore(deps): upgrade darling to 0.24
1 parent ad5c8d8 commit 596c068

10 files changed

Lines changed: 123 additions & 134 deletions

File tree

Cargo.lock

Lines changed: 67 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ bit-set = "0.8"
4545
chrono = "0.4"
4646
crossbeam-queue = "0.3"
4747
crossbeam-utils = "0.8"
48-
darling = "0.23"
48+
darling = "0.24.1"
4949
derive-where = "1"
5050
dtoa = "1"
5151
enum-map = "2"
@@ -62,7 +62,7 @@ metrics-util_020 = { package = "metrics-util", version = "0.20" }
6262
ordered-float = "5.1.0"
6363
papaya = "0.2"
6464
pin-project = "1"
65-
prettyplease = "0.2"
65+
prettyplease = "0.3"
6666
proc-macro2 = "1.0"
6767
quote = "1.0"
6868
rand = "0.9"
@@ -77,9 +77,7 @@ smallvec = "1.13.1"
7777
str_inflector = "0.12"
7878
strum_macros = "0.27"
7979
syn = "3.0"
80-
# Compatibility boundary for darling and synstructure, which still expose syn 2 AST types.
81-
syn2 = { package = "syn", version = "2.0" }
82-
synstructure = "0.13"
80+
synstructure = "0.14"
8381
shuttle = "0.9"
8482
tempfile = "3"
8583
tokio = { version = "1.38", default-features = false }

metrique-macro/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ proc-macro = true
1313

1414
[dependencies]
1515
syn = { workspace = true, features = ["full", "extra-traits", "visit-mut"] }
16-
syn2 = { workspace = true, features = ["full", "extra-traits"] }
1716
quote = { workspace = true }
1817
proc-macro2 = { workspace = true }
1918
Inflector = { workspace = true }

metrique-macro/src/aggregate.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ fn parse_aggregate_fields(input: &DeriveInput) -> Result<ParsedAggregate> {
126126
.filter(|attr| attr.path().is_ident("metrics"))
127127
.cloned()
128128
.collect();
129-
let has_unit = crate::RawMetricsFieldAttrs::from_field(&crate::field_to_syn2(field)?)
129+
let has_unit = crate::RawMetricsFieldAttrs::from_field(field)
130130
.ok()
131131
.and_then(|attrs| attrs.unit)
132132
.is_some();
@@ -530,7 +530,7 @@ mod tests {
530530

531531
fn aggregate_impl_string(input: Ts2) -> String {
532532
let output = aggregate_impl(input, false);
533-
match syn2::parse2::<syn2::File>(output.clone()) {
533+
match syn::parse2::<syn::File>(output.clone()) {
534534
Ok(file) => prettyplease::unparse(&file),
535535
Err(_) => output.to_string(),
536536
}
@@ -603,7 +603,7 @@ mod tests {
603603
};
604604

605605
let output = aggregate_impl(input, true);
606-
let parsed_file = match syn2::parse2::<syn2::File>(output.clone()) {
606+
let parsed_file = match syn::parse2::<syn::File>(output.clone()) {
607607
Ok(file) => prettyplease::unparse(&file),
608608
Err(_) => output.to_string(),
609609
};
@@ -622,7 +622,7 @@ mod tests {
622622
};
623623

624624
let output = aggregate_impl(input, false);
625-
let parsed_file = match syn2::parse2::<syn2::File>(output.clone()) {
625+
let parsed_file = match syn::parse2::<syn::File>(output.clone()) {
626626
Ok(file) => prettyplease::unparse(&file),
627627
Err(_) => output.to_string(),
628628
};

metrique-macro/src/emf.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
use darling::FromMeta;
55
use proc_macro2::TokenStream as Ts2;
66
use quote::{ToTokens, quote};
7-
use syn2::{Expr, spanned::Spanned};
7+
use syn::{Expr, spanned::Spanned};
88

99
#[derive(Debug, Clone)]
1010
pub(crate) struct DimensionSet {
1111
pub(crate) dimensions: Vec<Expr>,
1212
}
1313

1414
impl DimensionSet {
15-
fn from_expr(expr: &syn2::Expr) -> darling::Result<Self> {
15+
fn from_expr(expr: &syn::Expr) -> darling::Result<Self> {
1616
match expr {
17-
syn2::Expr::Array(array) => Ok(DimensionSet {
17+
syn::Expr::Array(array) => Ok(DimensionSet {
1818
dimensions: array.elems.iter().cloned().collect(),
1919
}),
2020
_other => Err(darling::Error::custom(
@@ -31,9 +31,9 @@ pub(crate) struct DimensionSets {
3131
}
3232

3333
impl FromMeta for DimensionSets {
34-
fn from_expr(expr: &syn2::Expr) -> darling::Result<Self> {
34+
fn from_expr(expr: &syn::Expr) -> darling::Result<Self> {
3535
match expr {
36-
syn2::Expr::Array(array) => {
36+
syn::Expr::Array(array) => {
3737
let mut accum = darling::Error::accumulator();
3838
let sets = array
3939
.elems

metrique-macro/src/enums.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ fn parse_variant_data(fields: &syn::Fields) -> MacroResult<Option<VariantData>>
105105
.unnamed
106106
.iter()
107107
.map(|field| -> MacroResult<TupleData> {
108-
let field2 = crate::field_to_syn2(field)?;
109-
let raw_attrs = RawMetricsFieldAttrs::from_field(&field2)?;
108+
let raw_attrs = RawMetricsFieldAttrs::from_field(field)?;
110109
let attrs = raw_attrs.validate()?;
111110

112111
match &attrs.kind {
@@ -203,8 +202,7 @@ pub(crate) fn parse_enum_variants(
203202
};
204203

205204
let attrs = if mode != VariantMode::SkipAttributeParsing {
206-
let variant2 = crate::variant_to_syn2(variant)?;
207-
match errors.handle(RawMetricsVariantAttrs::from_variant(&variant2)) {
205+
match errors.handle(RawMetricsVariantAttrs::from_variant(variant)) {
208206
Some(attrs) => attrs.validate(mode)?,
209207
None => {
210208
continue;

0 commit comments

Comments
 (0)