chore: update rust crate syn to v3 - #185
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
renovate
Bot
force-pushed
the
renovate/syn-3.x
branch
from
July 20, 2026 04:32
6603309 to
c506835
Compare
renovate
Bot
force-pushed
the
renovate/syn-3.x
branch
from
July 20, 2026 12:11
c506835 to
674e466
Compare
renovate
Bot
force-pushed
the
renovate/syn-3.x
branch
from
July 22, 2026 02:43
674e466 to
10c9b55
Compare
|
This PR currently has a merge conflict. Please resolve this and then re-add the |
renovate
Bot
force-pushed
the
renovate/syn-3.x
branch
from
July 27, 2026 02:34
10c9b55 to
abcefe4
Compare
renovate
Bot
force-pushed
the
renovate/syn-3.x
branch
from
August 12, 2026 01:49
abcefe4 to
22e678c
Compare
renovate
Bot
force-pushed
the
renovate/syn-3.x
branch
from
August 24, 2026 02:07
22e678c to
1fd0071
Compare
renovate
Bot
force-pushed
the
renovate/syn-3.x
branch
from
August 26, 2026 15:03
1fd0071 to
72a0ab1
Compare
renovate
Bot
force-pushed
the
renovate/syn-3.x
branch
from
September 2, 2026 22:44
72a0ab1 to
04834c1
Compare
renovate
Bot
force-pushed
the
renovate/syn-3.x
branch
from
September 4, 2026 21:05
04834c1 to
f1e18c3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
2→3Release Notes
dtolnay/syn (syn)
v3.0.5Compare Source
LitStr::parse_with(#2080, thanks @sunshowers)v3.0.4Compare Source
safe fninimpl Parse for ForeignItemFn(#2078)v3.0.3Compare Source
v3.0.2Compare Source
Error::new_range(start..end, "msg")(#2068, #2070)Cursor::prev_spanv3.0.1Compare Source
v3.0.0Compare 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::BareFnhas been renamed toType::FnPtrto mirror the compiler's terminology. Together with this,BareVariadicis renamed toFnPtrVariadic.The mutually exclusive
const_tokenandmutabilityfields ofType::Ptrhave been unified into an enum of typePointerMutability, which was already previously used byExpr::RawAddr.Every
Typevariant now holds attributes, which can represent the attributes of element types inside a tuple type, or attributes for a function return type.BareFnArgis renamed toNamedArgand is used inParenthesizedGenericArguments, in addition to the existing use inType::FnPtr.Expressions
Expr::Closure, the fieldsor1_tokenandor2_tokenhave been renamed toinputs_beginandinputs_endto indicate the beginning and ending|token of the closure inputs.Statements
Patterns
guardfield ofArmis replaced by a newPat::Guardvariant held in the arm'spat.Items
The
unsafetyfield ofSignature, which represented the presence or absence ofunsafe, is replaced by a 3-waySafetyenum which may be safe, unsafe, or default.ForeignItem::Staticalso gets aSafety.Some of the fields of
Receiverhave been split to a non-exhaustiveReceiverKindenum to create room for proposed new kinds of method receivers, such as pinned.Type aliases now hold a
WhereClausePlacementto 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::LifetimeandWherePredicate::Typehave a new field holding the attributes on the where-predicates.GenericParam::TypeandGenericParam::Constnow 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
Parseimplementation ofLifetimeno longer permits keyword lifetimes, matching a change in Rust 1.81 to deny such lifetimes pre-expansion.Lifetime::parse_anymay be used to parse lifetimes permissive of keywords.LitIntandLitFloatno longer implementFrom<proc_macro2::Literal>. UseLit::new(literal)and then matchLit::IntorLit::Float.The
StrStyleenum was unused and has been deleted.More
Filecontains a newOption<Frontmatter>, but does not yet parse frontmatter insyn::parse_fileuntil that language feature progresses closer to stabilization.Some enums no longer provide
Fromimpls. Construct the variant by name instead, such asExpr::Array(e)in place ofe.into().The
popmethod ofPunctuated<T, P>now returnsOption<T>discarding the trailing punctuation if any, rather thanOption<Pair<T, P>>. A new methodpop_pairprovides the old behavior.Syntax tree traversal (
visit,visit_mut,fold) no longer provides a method for processingSpan. This was already incompletely supported and never walked most of the spans in a syntax tree.The
SpeculativeandAnyDelimitertraits have been sealed and cannot be implemented for types outside of Syn'sParseStream.Configuration
📅 Schedule: (UTC)
🚦 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.
This PR was generated by Mend Renovate. View the repository job log.