Skip to content

Commit 92666ed

Browse files
committed
upgrade to syn 2.x
1 parent 276106b commit 92666ed

File tree

7 files changed

+14
-10
lines changed

7 files changed

+14
-10
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
name = "formality"
33
version = "0.1.0"
44
edition = "2021"
5+
license = "MIT OR APACHE-2"
6+
description = "Model of the Rust type system maintained by the Rust types team (in development)"
57

68
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
79

crates/formality-macros/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
name = "formality-macros"
33
version = "0.1.0"
44
edition = "2021"
5+
license = "MIT OR APACHE-2"
6+
description = "Macros used by a-mir-formality and formality-core"
57

68
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
79

@@ -11,8 +13,8 @@ proc-macro = true
1113
[dependencies]
1214
quote = "1.0.21"
1315
proc-macro2 = "1.0"
14-
syn = "1.0.102"
15-
synstructure = "0.12.6"
16+
syn = { version = "2.0", features = ["full"] }
17+
synstructure = "0.13.0"
1618
tracing = "0.1"
1719
convert_case = "0.6.0"
1820

crates/formality-macros/src/cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,5 @@ fn downcast_to_variant(s: &synstructure::Structure, v: &VariantInfo) -> TokenStr
9191
}
9292

9393
pub(crate) fn has_cast_attr(attrs: &[Attribute]) -> bool {
94-
attrs.iter().any(|a| a.path.is_ident("cast"))
94+
attrs.iter().any(|a| a.path().is_ident("cast"))
9595
}

crates/formality-macros/src/debug.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ fn debug_variant_with_attr(
237237
}
238238

239239
fn get_grammar_attr(attrs: &[Attribute]) -> Option<syn::Result<FormalitySpec>> {
240-
let attr = attrs.iter().find(|a| a.path.is_ident("grammar"))?;
240+
let attr = attrs.iter().find(|a| a.path().is_ident("grammar"))?;
241241
Some(attr.parse_args())
242242
}
243243

crates/formality-macros/src/parse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ fn lookahead(for_field: &Ident, op: Option<&FormalitySpecOp>) -> syn::Result<Lit
206206
}
207207

208208
fn get_grammar_attr(attrs: &[Attribute]) -> Option<syn::Result<FormalitySpec>> {
209-
let attr = attrs.iter().find(|a| a.path.is_ident("grammar"))?;
209+
let attr = attrs.iter().find(|a| a.path().is_ident("grammar"))?;
210210
Some(attr.parse_args())
211211
}
212212

crates/formality-macros/src/term.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn remove_formality_attributes(input: &mut DeriveInput) {
4040
for variant in &mut v.variants {
4141
variant
4242
.attrs
43-
.retain(|attr| !attr.path.is_ident("grammar") && !attr.path.is_ident("cast"));
43+
.retain(|attr| !attr.path().is_ident("grammar") && !attr.path().is_ident("cast"));
4444
}
4545
}
4646
}

0 commit comments

Comments
 (0)