Skip to content

chore: bump syn from 2.0.118 to 3.0.2 - #589

Open
dependabot[bot] wants to merge 5 commits into
mainfrom
dependabot/cargo/syn-3.0.2
Open

chore: bump syn from 2.0.118 to 3.0.2#589
dependabot[bot] wants to merge 5 commits into
mainfrom
dependabot/cargo/syn-3.0.2

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Jul 20, 2026

Copy link
Copy Markdown
Contributor

Bumps syn from 2.0.118 to 3.0.2.

Release notes

Sourced from syn's releases.

3.0.2

3.0.1

3.0.0

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.

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.

... (truncated)

Commits
  • 88ee7be Release 3.0.2
  • 587bc20 Merge pull request #2070 from dtolnay/emptyrange
  • 96801f7 Allow Error::new_range at empty cursor range
  • 9dc16c9 Merge pull request #2069 from dtolnay/prevspan
  • 1db76b7 Align on using impl trait across all Error constructors
  • bfa1ebf Make Cursor::prev_span public
  • c6ac5e5 Merge pull request #2068 from dtolnay/newrange
  • 1436454 Add Error::new_range constructor taking Range<Cursor>
  • 123c148 Release 3.0.1
  • bc11ddd Merge pull request #2067 from dtolnay/fastpeek
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [syn](https://github.com/dtolnay/syn) from 2.0.118 to 3.0.2.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](dtolnay/syn@2.0.118...3.0.2)

---
updated-dependencies:
- dependency-name: syn
  dependency-version: 3.0.2
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file rust Pull requests that update rust code labels Jul 20, 2026
Copilot AI review requested due to automatic review settings July 20, 2026 07:08
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file rust Pull requests that update rust code labels Jul 20, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.

Updates the Rust dependency on syn, apparently attempting a major-version upgrade.

Changes:

  • Bumped syn from 2.0.111 to 3.0.2 in Cargo.toml.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Vaiz

Vaiz commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@copilot, do a proper migration

…o syn 3.x

- Remove darling dependency from templated_uri_macros_impl (darling uses syn 2.x)
- Replace darling's FromAttributes/FromField with manual syn 3.x parsing
- Add required syn features to templated_uri_macros_impl Cargo.toml
- Bump prettyplease from 0.2.37 to 0.3.0 (syn 3.x compatible)
- Fix TypeGroup struct literal in thread_aware_macros_impl tests (new attrs field in syn 3.x)
Copilot AI review requested due to automatic review settings July 20, 2026 07:35
@dependabot
dependabot Bot removed the request for review from Copilot July 20, 2026 07:35

Copilot AI commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@copilot, do a proper migration

Done. Here's what the proper migration involved (commit fix: migrate templated_uri_macros_impl and thread_aware_macros_impl to syn 3.x):

  1. templated_uri_macros_impl: Removed the darling dependency (darling 0.23 still depends on syn 2.x) and replaced #[derive(FromAttributes)] / #[derive(FromField)] with manual parse_nested_meta-based parsing using syn 3.x. Added explicit syn features (derive, full, parsing, printing, proc-macro) to the crate's Cargo.toml.

  2. prettyplease: Bumped from 0.2.37 to 0.3.0 — the syn 3.x-compatible version released last Friday.

  3. thread_aware_macros_impl tests: Fixed a TypeGroup struct literal that was missing the new attrs: Vec<Attribute> field added in syn 3.x.

All crates build and tests pass. The only remaining syn 2.x in the lockfile is from external transitive dependencies (async-trait, serde_derive, Azure SDK crates, etc.) that we don't control.

Copilot finished work on behalf of Vaiz July 20, 2026 07:37
Copilot AI requested a review from Vaiz July 20, 2026 07:37
@martintmk

Copy link
Copy Markdown
Member

I think is a case where we should wait for crates that depend on new syn 3.0 to catch-up and then do the switch. No need to rush.

For example, darling is already being upgraded:
TedDriggs/darling#431

@Vaiz Vaiz added the blocked Blocked by another PR/issue label Jul 22, 2026
@dependabot @github

dependabot Bot commented on behalf of github Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

A newer version of syn exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.

@Vaiz
Vaiz marked this pull request as draft July 29, 2026 08:54
@Vaiz

Vaiz commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@copilot, rebase the branch and fix all conflicts

Copilot AI review requested due to automatic review settings July 29, 2026 09:01
@dependabot
dependabot Bot removed the request for review from Copilot July 29, 2026 09:01

Copilot AI commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@copilot, rebase the branch and fix all conflicts

Done. Merged origin/main into the branch and resolved the two Cargo.toml conflicts:

  • prettyplease: kept 0.3.0 (syn 3.x compatible) and added proc-macro-crate = "3.5.0" from main.
  • syn: kept 3.0.2 and added the templated_uri* / testing_aids entries that main introduced.

Copilot finished work on behalf of Vaiz July 29, 2026 09:01
@psandana
psandana marked this pull request as ready for review July 29, 2026 15:31
Copilot AI review requested due to automatic review settings July 29, 2026 15:31
@psandana

Copy link
Copy Markdown
Contributor

🛡️ Build Sentinel — marked ready-for-review to trigger the full anvil-pr matrix.

What this PR is: a real syn 2 → 3 major migration for the two proc-macro crates that were blocked on it (templated_uri_macros_impl, data_privacy_macros_impl). The migration commits drop the darling dependency and hand-roll attribute parsing on syn 3's parse_nested_meta (that's why darling/ident_case leave Cargo.lock). It builds — Analyze (rust) and CodeQL are green.

Reviewer call-out (design): only these two crates adopt syn 3.0.2; the rest of the workspace still pulls syn 2.0.119 transitively (argh, etc.), so the lockfile now carries two syn majors until the rest of the ecosystem moves. Please sign off on that dual-version build cost, and review the migrated attribute-parsing logic for behavioral parity with the old darling derives.

Not merging — posting for owner review/approval.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

crates/templated_uri_macros_impl/src/struct_template.rs:58

  • The missing-template diagnostic is currently emitted at Span::call_site(), which can make the error hard to locate in user code. Prefer spanning it to the actual #[templated(...)] attribute when present (and adjust the message to refer to the nested meta key).
        let input_template = input_template.ok_or_else(|| {
            syn::Error::new(
                proc_macro2::Span::call_site(),
                "missing required `template` attribute in `#[templated(...)]`",
            )
        })?;

Comment thread Cargo.toml
smol = { version = "2.0.0", default-features = false }
static_assertions = { version = "1.1.0", default-features = false }
syn = { version = "2.0.111", default-features = false }
syn = { version = "3.0.2", default-features = false }
Copilot AI review requested due to automatic review settings July 29, 2026 15:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

crates/templated_uri_macros_impl/src/struct_template.rs:58

  • The "missing required template" error is currently created with Span::call_site(), which tends to point diagnostics at the macro call site/crate root rather than the actual #[templated(...)] attribute. Using the #[templated] attribute span (when present) will produce a more actionable error location for users.
        let input_template = input_template.ok_or_else(|| {
            syn::Error::new(
                proc_macro2::Span::call_site(),
                "missing required `template` attribute in `#[templated(...)]`",
            )

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

Labels

blocked Blocked by another PR/issue dependencies Pull requests that update a dependency file rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants