Skip to content

Commit

Permalink
build(deps): update syn requirement from 1.0.109 to 2.0.38
Browse files Browse the repository at this point in the history
Updates the requirements on [syn](https://github.com/dtolnay/syn) to permit the latest version.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](dtolnay/syn@1.0.109...2.0.38)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
  • Loading branch information
dependabot[bot] authored and M-Adoo committed Oct 8, 2023
1 parent 81ac60b commit 8e229e1
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ scoped_threadpool = "0.1.9"
serde = "1.0"
serde_json = "1.0.82"
smallvec = "1.8.0"
syn = "1.0.109"
syn = "2.0.38"
tiny-skia-path = {version = "0.11.0"}
unicode-bidi = "0.3.7"
unicode-script = "0.5.4"
Expand Down
5 changes: 1 addition & 4 deletions macros/builtin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,4 @@ proc-macro = true
proc-macro2.workspace = true
quote.workspace = true
smallvec.workspace = true

[dependencies.syn]
features = ["full"]
version = "1.0.109"
syn ={ workspace=true, features = ["full"]}
8 changes: 4 additions & 4 deletions macros/builtin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ impl ToTokens for Item {
Item::Field { doc_attr, mem, _colon, ty } => {
let ty = quote! { #ty }.to_string();
let name = mem.to_string();
let doc = match &doc_attr.lit {
syn::Lit::Str(str) => str,
let doc = match &doc_attr.value {
syn::Expr::Lit(syn::ExprLit { lit: syn::Lit::Str(str), .. }) => str,
_ => unreachable!(),
};
tokens.extend(quote! {
Expand All @@ -96,8 +96,8 @@ impl ToTokens for Item {
Item::Method { doc_attr, sign } => {
let name = sign.ident.to_string();
let sign = sign.to_token_stream().to_string();
let doc = match &doc_attr.lit {
syn::Lit::Str(str) => str,
let doc = match &doc_attr.value {
syn::Expr::Lit(syn::ExprLit { lit: syn::Lit::Str(str), .. }) => str,
_ => unreachable!(),
};
tokens.extend(quote! {
Expand Down
7 changes: 3 additions & 4 deletions macros/src/declare_derive2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,9 @@ fn collect_filed_and_attrs(stt: &mut DataStruct) -> Result<Punctuated<DeclareFie
.pairs_mut()
.try_for_each::<_, syn::Result<()>>(|pair| {
let (field, comma) = pair.into_tuple();
let idx = field
.attrs
.iter()
.position(|attr| attr.path.is_ident(DECLARE_ATTR));
let idx = field.attrs.iter().position(
|attr| matches!(&attr.meta, syn::Meta::List(l) if l.path.is_ident(DECLARE_ATTR)),
);
let builder_attr = if let Some(idx) = idx {
let attr = field.attrs.remove(idx);
let args: DeclareAttr = attr.parse_args()?;
Expand Down
6 changes: 3 additions & 3 deletions macros/src/rdl_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use syn::{
parse_macro_input, parse_quote,
punctuated::Punctuated,
spanned::Spanned,
token::{Bang, Brace, Colon, Comma, Dollar},
token::{Brace, Colon, Comma, Dollar, Not},
Expr, Ident, Macro, Path, Result as SynResult, Stmt,
};

Expand Down Expand Up @@ -115,7 +115,7 @@ impl Parse for StructLiteral {
break;
}

if content.peek(kw::rdl) && content.peek2(Bang) {
if content.peek(kw::rdl) && content.peek2(Not) {
children.push(content.parse()?);
} else if content.peek(Ident) {
let f: DeclareField = content.parse()?;
Expand All @@ -142,7 +142,7 @@ impl Parse for StructLiteral {

impl Parse for RdlParent {
fn parse(input: ParseStream) -> SynResult<Self> {
if input.peek(kw::_dollar_ಠ_ಠ) && input.peek2(Bang) {
if input.peek(kw::_dollar_ಠ_ಠ) && input.peek2(Not) {
let mac: Macro = input.parse()?;

Ok(RdlParent::Var(mac.parse_body_with(
Expand Down
5 changes: 1 addition & 4 deletions macros/src/symbol_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,8 @@ impl Fold for DollarRefsCtx {
fn fold_local(&mut self, mut i: syn::Local) -> syn::Local {
// we fold right expression first, then fold pattern, because the `=` is a
// right operator.
i.init = i
.init
.map(|(assign, e)| (assign, Box::new(self.fold_expr(*e))));
i.init = i.init.map(|init| self.fold_local_init(init));
i.pat = self.fold_pat(i.pat);

i
}

Expand Down

0 comments on commit 8e229e1

Please sign in to comment.