Skip to content

chore(deps): update rust crate syn to v3#183

Open
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/syn-3.x
Open

chore(deps): update rust crate syn to v3#183
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/syn-3.x

Conversation

@renovate

@renovate renovate Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Type Update Change
syn workspace.dependencies major 23

Release Notes

dtolnay/syn (syn)

v3.0.3

Compare Source

  • Documentation improvements

v3.0.2

Compare Source

v3.0.1

Compare Source

v3.0.0

Compare Source

This release contains adjustments to the syntax tree to account for ongoing Rust language development from the 3 years since syn 2.0.0 and to anticipate some in-flight Rust language RFCs.

These include: default values in fields, pinned type sugar, raw lifetimes, generator blocks and functions, unnamed enum variants, attributes in tuple types and tuple patterns, named arguments in parenthesized generic argument lists, lightweight clones, const traits, const function pointers, mutability restricted fields, supertrait auto implementation, final associated functions, trait implementability restrictions, const blocks in path arguments, item-level const blocks, return type notation, never patterns, function delegation, mutable by-reference bindings, in-place initialization, field projections, explicitly dyn-compatible traits, view types, file-level frontmatter, generic const arguments, guard patterns, lazy type aliases, explicitly safe foreign items, super let, unsafe fields, pattern types, heterogeneous try-blocks, function contracts, async function trait bounds, static closure coroutine syntax, unsafe binder types, move expressions, for-await loops, and postfix keywords.


[API documentation for 3.0]

Breaking changes

Modifiers

To reserve more room for language evolution, there are 10 new non-exhaustive structs in the syntax tree having the following commonality:

  • Name ending in Modifiers. {BlockModifiers, ClosureModifiers, ConstModifiers, FieldModifiers, FnModifiers, ImplModifiers, LocalModifiers, TraitBoundModifiers, TraitModifiers, TypeModifiers}

  • Each implements Default. The default value is guaranteed to comprise no tokens.

  • Non-exhaustive. Can only be instantiated by Syn's parser or by creating and then mutating ▁▁Modifiers::default().

  • Does not implement Parse. When parsing, they are parsed by the enclosing syntax tree node.

  • Does not implement ToTokens. In some cases the syntax that these nodes might hold in the future is not necessarily contiguous tokens.

  • Provides .require_empty() -> Result<()> which returns a meaningfully spanned error if the modifiers are different from the empty default. This enables a caller to reject syntax it does not recognize without knowing what that syntax may be.

Types

  • Type::BareFn has been renamed to Type::FnPtr to mirror the compiler's terminology. Together with this, BareVariadic is renamed to FnPtrVariadic.

  • The mutually exclusive const_token and mutability fields of Type::Ptr have been unified into an enum of type PointerMutability, which was already previously used by Expr::RawAddr.

  • Every Type variant now holds attributes, which can represent the attributes of element types inside a tuple type, or attributes for a function return type.

  • BareFnArg is renamed to NamedArg and is used in ParenthesizedGenericArguments, in addition to the existing use in Type::FnPtr.

Expressions

  • In Expr::Closure, the fields or1_token and or2_token have been renamed to inputs_begin and inputs_end to indicate the beginning and ending | token of the closure inputs.

Statements

  • Attributes are now preserved on all expression kinds in statement position. Previously, parsing would silently lose attributes on some expression statements without a dedicated Expr variant, such as tail-call expressions.

Patterns

  • The guard field of Arm is replaced by a new Pat::Guard variant held in the arm's pat.

Items

  • The unsafety field of Signature, which represented the presence or absence of unsafe, is replaced by a 3-way Safety enum which may be safe, unsafe, or default. ForeignItem::Static also gets a Safety.

  • Some of the fields of Receiver have been split to a non-exhaustive ReceiverKind enum to create room for proposed new kinds of method receivers, such as pinned.

  • Type aliases now hold a WhereClausePlacement to distinguish between early placement (which is the default for item-level type aliases and is deprecated in associated type aliases) and late placement (which is the default for associated type aliases and is unstable in item-level type aliases). Parsing and printing a syntax tree will now preserve the where-clause placement rather than rewriting it to the default placement for the item kind.

Generics

  • WherePredicate::Lifetime and WherePredicate::Type have a new field holding the attributes on the where-predicates.

  • GenericParam::Type and GenericParam::Const now match the rest of the syntax tree in holding their optional default using a single Option of tuple, rather than a pair of Option.

Literals

  • The Parse implementation of Lifetime no longer permits keyword lifetimes, matching a change in Rust 1.81 to deny such lifetimes pre-expansion. Lifetime::parse_any may be used to parse lifetimes permissive of keywords.

  • LitInt and LitFloat no longer implement From<proc_macro2::Literal>. Use Lit::new(literal) and then match Lit::Int or Lit::Float.

  • The StrStyle enum was unused and has been deleted.

More

  • File contains a new Option<Frontmatter>, but does not yet parse frontmatter in syn::parse_file until that language feature progresses closer to stabilization.

  • Some enums no longer provide From impls. Construct the variant by name instead, such as Expr::Array(e) in place of e.into().

  • The pop method of Punctuated<T, P> now returns Option<T> discarding the trailing punctuation if any, rather than Option<Pair<T, P>>. A new method pop_pair provides the old behavior.

  • Syntax tree traversal (visit, visit_mut, fold) no longer provides a method for processing Span. This was already incompletely supported and never walked most of the spans in a syntax tree.

  • The Speculative and AnyDelimiter traits have been sealed and cannot be implemented for types outside of Syn's ParseStream.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.61%. Comparing base (c28c008) to head (ce40bec).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #183      +/-   ##
==========================================
+ Coverage   70.34%   70.61%   +0.27%     
==========================================
  Files          18       18              
  Lines        1106     1106              
==========================================
+ Hits          778      781       +3     
+ Misses        328      325       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Details
Benchmark suite Current: ce40bec Previous: d81a39f Ratio
v_jsonescape/Escaping/huge 341663 ns/iter (± 2638) 277028 ns/iter (± 4954) 1.23
v_jsonescape/Escaping/huge escaped 278186 ns/iter (± 7591) 241758 ns/iter (± 2010) 1.15
v_jsonescape/Escaping/small 261 ns/iter (± 7) 297 ns/iter (± 11) 0.88
v_jsonescape/Escaping/small escaped 231 ns/iter (± 3) 247 ns/iter (± 1) 0.94
v_jsonescape/Escaping/tiny 54 ns/iter (± 0) 58 ns/iter (± 0) 0.93
v_jsonescape/Escaping/tiny escaped 31 ns/iter (± 0) 30 ns/iter (± 1) 1.03
v_jsonescape/Escaping/very tiny 9 ns/iter (± 0) 8 ns/iter (± 0) 1.13
v_jsonescape/Escaping/very tiny escaped 9 ns/iter (± 0) 8 ns/iter (± 0) 1.13
v_jsonescape/Escaping/ultra tiny 11 ns/iter (± 0) 12 ns/iter (± 0) 0.92
v_jsonescape/Escaping/ultra tiny escaped 11 ns/iter (± 0) 12 ns/iter (± 0) 0.92
v_jsonescape/Escaping/one 8 ns/iter (± 0) 9 ns/iter (± 0) 0.89
v_jsonescape/Escaping/one escaped 8 ns/iter (± 0) 9 ns/iter (± 0) 0.89
v_jsonescape/Escaping/empty 3 ns/iter (± 0) 3 ns/iter (± 0) 1

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: ce40bec Previous: d81a39f Ratio
v_jsonescape/Escaping/huge 341663 ns/iter (± 2638) 277028 ns/iter (± 4954) 1.23

This comment was automatically generated by workflow using github-action-benchmark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants