-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Rust crate syn to v2 #83
Open
renovate
wants to merge
1
commit into
main
Choose a base branch
from
renovate/syn-2.x
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
from
April 17, 2023 11:12
06d3d75
to
ddbe512
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
from
May 28, 2023 10:35
ddbe512
to
45fb91d
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
2 times, most recently
from
June 8, 2023 09:30
59c8d20
to
63f615b
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
3 times, most recently
from
June 25, 2023 01:12
41b6d07
to
5c2c0ad
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
3 times, most recently
from
July 9, 2023 19:59
5b73297
to
1e81c4d
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
2 times, most recently
from
July 21, 2023 03:28
afa1894
to
d2a009c
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
from
July 31, 2023 04:11
d2a009c
to
2e99108
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
from
August 17, 2023 07:27
2e99108
to
4f9e7a6
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
2 times, most recently
from
September 3, 2023 19:45
5c4855e
to
92b210d
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
5 times, most recently
from
September 16, 2023 22:50
3f62b1d
to
6029fab
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
from
September 18, 2023 06:41
6029fab
to
5759d76
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
from
October 5, 2023 21:41
5759d76
to
0b1f1cb
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
from
November 6, 2023 04:25
0b1f1cb
to
3fefa21
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
2 times, most recently
from
December 13, 2023 02:06
ef37332
to
761e7b5
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
2 times, most recently
from
December 25, 2023 06:07
d252c13
to
7eb4be8
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
from
January 1, 2024 03:12
7eb4be8
to
da8a202
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
from
May 24, 2024 01:28
283fe60
to
dd06195
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
2 times, most recently
from
June 24, 2024 01:09
804e6c8
to
238d753
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
3 times, most recently
from
July 12, 2024 17:02
ec9e2d0
to
5c2878b
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
from
July 22, 2024 01:13
5c2878b
to
f522e62
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
3 times, most recently
from
August 17, 2024 21:24
479e57c
to
7cfa018
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
2 times, most recently
from
August 31, 2024 00:50
51609d0
to
f2f35b6
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
2 times, most recently
from
September 27, 2024 21:42
912398f
to
6888093
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
5 times, most recently
from
October 24, 2024 00:13
8fcceee
to
1269c46
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
2 times, most recently
from
November 2, 2024 18:40
183ad33
to
3852cbd
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
2 times, most recently
from
November 21, 2024 06:15
de0dbf1
to
a8090a8
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
from
November 30, 2024 01:42
a8090a8
to
d8d551c
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
3 times, most recently
from
December 28, 2024 21:25
4f79e47
to
b24fbbb
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
from
January 1, 2025 22:34
b24fbbb
to
19d571e
Compare
renovate
bot
force-pushed
the
renovate/syn-2.x
branch
from
January 5, 2025 07:57
19d571e
to
67d3d5e
Compare
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:
Test plan: CI should pass with updated dependencies. No review required: this is an automated dependency update PR.
Release Notes
dtolnay/syn (syn)
v2.0.95
Compare Source
v2.0.94
Compare Source
v2.0.93
Compare Source
x as T <<= y
(#1804),break as T
(#1805),match x { _ if .. => {} }
(#1807)|| -> T 'a: {}
(#1806),if break x {}
(#1808, #1810)v2.0.92
Compare Source
v2.0.91
Compare Source
Vec<Arm>
usingparse_quote!
(#1796, #1797)v2.0.90
Compare Source
(#[attr] thing).field
(#1785)(thing.field)()
andthing.0()
(#1786)v2.0.89
Compare Source
v2.0.88
Compare Source
parse_str
(#1783)v2.0.87
Compare Source
Cursor::any_group
(#1777)Expr::peek
(#1778)v2.0.86
Compare Source
parse_quote!
to produce Vec<Attribute> (#1775)v2.0.85
Compare Source
v2.0.84
Compare Source
impl Sized + use<Self>
(#1772)v2.0.83
Compare Source
v2.0.82
Compare Source
Parse
impls for PreciseCapture and CapturedParam (#1757, #1758)unsafe
attributes (#1759)v2.0.81
Compare Source
impl Trait + use<'a, T>
(#1752, #1753, #1754)v2.0.80
Compare Source
Expr::RawAddr
(#1743)v2.0.79
Compare Source
use
items containing absolute paths (#1742)v2.0.78
Compare Source
v2.0.77
Compare Source
Expr::Tuple
in non-"full" mode (#1727)v2.0.76
Compare Source
become
keyword is followed by an expression (#1725)v2.0.75
Compare Source
v2.0.74
Compare Source
Generics
iterator methods (#1719)v2.0.73
Compare Source
Fields::members
iterator (#1716, thanks @Fancyflame)v2.0.72
Compare Source
use<'a, T>
precise capturing bounds (#1707, thanks @compiler-errors)v2.0.71
Compare Source
v2.0.70
Compare Source
v2.0.69
Compare Source
Punctuated::get
andget_mut
(#1693)v2.0.68
Compare Source
parse_quote!
parses invalid syntax (#1690, thanks @stepancheg)Group
andLifetime
(#1687)v2.0.67
Compare Source
LitCStr
in ParseStream::peek (#1682)v2.0.66
Compare Source
v2.0.65
Compare Source
Fold
to compile faster (#1666, #1667, #1668)v2.0.64
Compare Source
catch_unwind
(#1646)break
andreturn
in loop headers (#1656)v2.0.63
Compare Source
v2.0.62
Compare Source
v2.0.61
Compare Source
v2.0.60
Compare Source
peek
(#1625)v2.0.59
Compare Source
c"…"
andcr"…"
C-string literal syntax asLit::CStr
(#1502)v2.0.58
Compare Source
$
incustom_punctuation!
macro (#1611)v2.0.57
Compare Source
quote
when built with default-features disabled and the "proc-macro" feature enabled (#1608, thanks @BD103)v2.0.56
Compare Source
v2.0.55
Compare Source
v2.0.54
Compare Source
custom_keyword!
with syn's "printing" feature disabled (#1602)v2.0.53
Compare Source
v2.0.52
Compare Source
v2.0.51
Compare Source
v2.0.50
Compare Source
v2.0.49
Compare Source
LitStr::parse
(#1590)v2.0.48
Compare Source
else
(#1578)v2.0.47
Compare Source
v2.0.46
Compare Source
v2.0.45
Compare Source
DeriveInput
asExpr::Verbatim
in non-"full" mode, instead of error (#1513)PatType
withparse_quote!
(#1573)v2.0.44
Compare Source
v2.0.43
Compare Source
v2.0.42
Compare Source
v2.0.41
Compare Source
parse_quote!
(#1548)v2.0.40
Compare Source
v2.0.39
Compare Source
v2.0.38
Compare Source
bool
as a custom keyword (#1518, thanks @Vanille-N)v2.0.37
Compare Source
v2.0.36
Compare Source
--generate-link-to-definition
documentation builds (#1514)v2.0.35
Compare Source
Token!
macro (#1510, #1512)v2.0.34
Compare Source
v2.0.33
Compare Source
(/*ERROR*/)
placeholder that rustc uses for macros that fail to expandv2.0.32
Compare Source
Path::require_ident
accessor (#1496, thanks @Fancyflame)v2.0.31
Compare Source
v2.0.30
Compare Source
v2.0.29
Compare Source
v2.0.28
Compare Source
v2.0.27
Compare Source
v2.0.26
Compare Source
Spanned
forQSelf
(#1465)v2.0.25
Compare Source
v2.0.24
Compare Source
v2.0.23
Compare Source
where [(); { T::COUNT }]:
in non-"full" mode (#1478)v2.0.22
Compare Source
c"…"
c-string literals (tracking issue: https://github.com/rust-lang/rust/issues/105723)v2.0.21
Compare Source
LitByteStr::value
in the case of a cooked byte string literal containing form feed or vertical tab characters following an escaped newline (#1474)v2.0.20
Compare Source
v2.0.19
Compare Source
v2.0.18
Compare Source
v2.0.17
Compare Source
v2.0.16
Compare Source
builtin #
syntax as Expr::Verbatim (https://github.com/rust-lang/rust/issues/110680, #1454)v2.0.15
Compare Source
Type::Tuple
of length 1 prints as a tuple even if trailing comma is not provided in the Punctuated (#1444, thanks @Fancyflame)v2.0.14
Compare Source
v2.0.13
Compare Source
v2.0.12
Compare Source
compile_error!
by absolute path in token stream produced by syn::Error::to_compile_error (#1431, thanks @smoelius)v2.0.11
Compare Source
v2.0.10
Compare Source
v2.0.9
Compare Source
type
items in an extern block, trait, or module from being markeddefault
impl T { fn f(&self); }
— omitted function bodies are allowed by TraitItemFn, but inimpl
blocks this syntax is now parsed as ImplItem::Verbatim rather than ImplItem::Fnv2.0.8
Compare Source
try
keyword as 2015-edition identifier in definition of try macro (#1422)v2.0.7
Compare Source
mut self
inside of Type::BareFnv2.0.6
Compare Source
v2.0.5
Compare Source
ExprMacro
data structure even whenfeatures="full"
is not used (#1417)v2.0.4
Compare Source
v2.0.3
Compare Source
ExprGroup
data structure even whenfeatures="full"
is not used (#1412)v2.0.2
Compare Source
v2.0.1
Compare Source
v2.0.0
Compare Source
This release contains a batch of syntax tree improvements to incorporate ongoing Rust language development from the past 3.5 years since syn 1.
It never seems like an ideal time to finalize a syntax tree design, considering the frankly alarming number of syntax-disrupting language features currently in flight: keyword generics, restrictions, capabilities and contexts, conditional constness, new varieties of literals, dyn revamp such as explicitly dyn-safe traits and dyn-star, expression syntax in various phases of being added or being torn out (const blocks, try blocks, raw references), auto traits and negative impls, generalizations to higher rank trait bounds, async closures and static async trait methods, postfix keywords, pattern types, return type notation, unsafe attributes, …
The plan continues to be the same as laid out originally in the 1.0.0 release announcement:
If anything, the takeaway from the 3.5 year longevity of syn 1 is that this period was tamer from a language development perspective than anticipated, but that is unlikely to last and I think around 24 months is still the correct cadence to expect between releases going forward.
[API documentation for 2.0]
Breaking changes
Expressions
Support for
box expr
syntax has been deleted, as it has been deleted recently from rustc.Support for type ascription syntax
expr: Type
in expression position has been deleted.Support for unstable
&raw const expr
raw-pointer reference syntax has been deleted.The representation of generic arguments has been unified between method calls and non-method paths into a single
GenericArgument
type, which supersedes the previousGenericMethodArgument
andMethodTurbofish
.Generic arguments now distinguish between associated types (
AssocType
) and associated constant values (AssocConst
). Previously these would be parsed ambiguously asBinding
.The binary assignment operators in
BinOp
have been renamed to align with the naming used by the standard library'score::ops
module's traits. For exampleBinOp::AddEq
is now calledBinOp::AddAssign
.Expr::Struct
struct construction expressions now support structs which are a variant of an enum associated type of a trait, as in<Type as Trait>::Assoc::Variant { ... }
, which has recently been added to Rust.Expr::Range
now follows thestart
andend
naming used by the standard library'sRangeBounds
trait, rather thanfrom
/to
orlo
/hi
.Expr::AssignOp
has been merged intoExpr::Binary
, which now represents both non-assignment and assignment binary operators.Stricter parsing of ranges. None of the following are valid expressions, but were previously accepted by syn:
..=
,lo..=
,...
,...hi
,lo...
,lo...hi
.Expr::Closure
now includes a representation forfor<...>
lifetimes.Statements
Variants
Stmt::Expr
(tail-position expression without trailing semicolon) andStmt::Semi
(non-tail expression with trailing semicolon) have been combined intoStmt::Expr
with the optional semicolon represented byOption<Token![;]>
.The syntax tree for
Stmt::Local
has been extended to handlelet
/else
syntax.Macros in statement position are now uniformly parsed as
Stmt::Macro
. Previously these would be disambiguated toStmt::Item
, although it was ambiguous whether a macro in statement position would expand to an item (likethread_local! { ... }
) vs an expression (likeprintln! { ... }
).Patterns
Pattern parsing for all the different syntactic positions in which patterns are allowed has been split into
Pat::parse_single
(for function- and closure-argument position, where top-level|
is not allowed),Pat::parse_multi
(where|
is allowed) andPat::parse_multi_with_leading_vert
(for the pattern of match arms, which allow an optional leading|
). Previously only a singleparse
behavior was supported and behaved like the newparse_single
.The
Pat
syntax tree now shares more common data structures with theExpr
syntax tree where possible, such as for literals, paths, macros, and ranges in pattern position.Parsing of struct field patterns does a better job rejecting bogus syntax such as
Struct { 0 asdf }
andStruct { ref mut 0: asdf }
, which were previously incorrectly accepted.Pat::Range
now supports one-sided ranges by representing the start and end bound of the range byOption<Expr>
.Pat::Struct
keeps track of attributes on the optional..
"rest" part of the pattern, as inlet Struct { x, #[cfg(any())] .. } = _;
.Parsing unary negation now enforces that only literal patterns can be unarily negated. For example
-self::CONST
and-const { 0i32 }
are not valid syntax in pattern position.Pat::TupleStruct
no longer wraps a value of typePatTuple
but represents that information in its fields directly.A single parenthesized pattern without trailing comma inside the parentheses is no longer considered a
Pat::Tuple
, it will be parsed asPat::Paren
.One-sided range patterns are no longer allowed inside of slice patterns.
[lo..]
and[..=hi]
are not considered valid pattern syntax by Rust.Items
Typed
self
in a method signature, such asself: Pin<&mut Self>
, will now be parsed asFnArg::Receiver
. This meansself
, whether with or without an explicit type, is always treated as aReceiver
. Previously only the&self
and&mut self
shorthand receivers were parsed asReceiver
.TraitItem::Method
andImplItem::Method
have been renamed toTraitItem::Fn
andImplItem::Fn
, as they do not necessarily represent methods if the function signature contains noself
.Item::Macro2
has been deleted as "macros 2.0" syntax is no longer considered on track for stabilization.Various item kinds now hold
Generics
which didn't used to have them.The variadic argument of an extern function signature can now be given an optional parameter name.
WherePredicate::Eq
is no longer supported.Visibility::Crate
is no longer supported. This syntax has been removed from rustc.Public visibility is now represented by a single
Token![pub]
token rather than the oldVisPublic
struct.LifetimeDef
is now calledLifetimeParam
. This name makes more sense in the context of theGenericParam
enum (which also includesTypeParam
andConstParam
), and is the name that the Rust Reference uses.Modules and extern blocks (
Item::Mod
andItem::ForeignMod
) can now be markedunsafe
.Attributes
The syntax tree for
Attribute
has been redesigned. The new API better accommodates attributes which mix structured and unstructured content at different levels of nesting.AttributeArgs
has been removed. UsePunctuated<Meta, Token![,]>
.For parsing attribute contents,
parse_meta()
is superseded by a new parsing library calledsyn::meta
, and theparse_nested_meta
method onAttribute
.Tokens
In string literals, the handling of non-ASCII whitespace after trailing
\
now matches what is implemented by rustc. Space, horizontal tab, line feed, and carriage return are the only 4 whitespace characters which are supposed to be stripped from the beginning of the next line.The delimiter tokens
syn::token::Paren
,Bracket
, andBrace
now store 2 spans (the open and close punctuation separately) rather than just 1. Use.join()
to obtain a singleSpan
spanning the whole group.Keyword construction now requires a single span; an array of 1 span is no longer accepted. Use
Token![trait](span)
instead ofToken![trait]([span])
.Some token types have been renamed to conform with terminology used by the Rust Reference. These are
Add
->Plus
,Bang
->Not
,Colon2
->PathSep
,Div
->Slash
,Dot2
->DotDot
,Dot3
->DotDotDot
,Rem
->Percent
, andSub
->Minus
.More
Several enums have been made
#[non_exhaustive]
in anticipation of upcoming language changes. This includesWherePredicate
,Lit
, andGenericArgument
.The
impl Extend<Pair<T, P>> for Punctuated<T, P>
now requiresP: Default
and will push a default punctuation between the pre-existing elements and the new ones, if there is not already a trailing punctuation. Previously it would panic in this situation.ParseStream::parse_terminated
now takes a peek-style punctuation argument instead of turbofish. Replaceinput.parse_terminated::<_, Token![,]>(Thing::parse)
withinput.parse_terminated(Thing::parse, Token![,])
.v1.0.109
Compare Source
v1.0.108
Compare Source
LitStr::value
(#1381, thanks @ModProg)v1.0.107
Compare Source
-Zrustdoc-scrape-examples
on docs.rs for nowv1.0.106
Compare Source
v1.0.105
Compare Source
dyn
andimpl
type syntax (#1245)v1.0.104
Compare Source
PathArguments::is_none()
v1.0.103
Compare Source
PartialOrd
forCursor
(#1236, #1237, thanks @CAD97)v1.0.102
Compare Source
TokenBuffer
(#1223, thanks @CAD97)v1.0.101
Compare Source
v1.0.100
Compare Source
for<> || -> T {…}
(#1212, https://github.com/rust-lang/rust/issues/97362)dyn*
provisional syntax (#1213, https://github.com/rust-lang/rust/issues/91611)Struct { #[attr] .. }
(#1214)static async
andstatic async move
closures (#1215, https://github.com/rust-lang/rust/issues/62290)v1.0.99
Compare Source
v1.0.98
Compare Source
v1.0.97
Compare Source
v1.0.96
Compare Source
punct_mut()
method onsyn::punctuated::Pair
to returnOption<&mut P>
(#1183)v1.0.95
Compare Source
v1.0.94
Compare Source
v1.0.93
Compare Source
Some
means something unusual in the expression namespace of the scope wherecustom_keyword
is invoked (#1171, thanks @zakarumych)v1.0.92
Compare Source
v1.0.91
Compare Source
v1.0.90
Compare Source
Update recommended exhaustive matching idiom to use
non_exhaustive_omitted_patterns
lint:v1.0.89
Compare Source
mut self
in a bare fn type (#1148)v1.0.88
Compare Source
..
pattern in pattern oflet
(#1136)for<…>
lifetime introducer on closures (#1135)Nothing
(#1144)v1.0.87
Compare Source
Configuration
📅 Schedule: Branch creation - "on the 1st through 7th day of the month" in timezone America/Los_Angeles, 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.
This PR was generated by Mend Renovate. View the repository job log.