FindoraNetwork / platform

Official Implementation of Findora Network.
https://findora.org
Other
73 stars 29 forks source link

Update syn requirement from 1.0 to 2.0 #894

Closed dependabot[bot] closed 1 year ago

dependabot[bot] commented 1 year ago

Updates the requirements on syn to permit the latest version.

Release notes

Sourced from syn's releases.

2.0.0

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:

Be aware that the underlying Rust language will continue to evolve. Syn is able to accommodate most kinds of Rust grammar changes via the nonexhaustive enums and Verbatim variants in the syntax tree, but we will plan to put out new major versions on a 12 to 24 month cadence to incorporate ongoing language changes as needed.

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.

Breaking changes

  • Minimum required Rust version is raised from rustc 1.31 to 1.56.

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 path into a single GenericArgument type, which supersedes the previous GenericMethodArgument and MethodTurbofish.

  • Generic arguments now distinguish between associated types (AssocType) and associated constant values (AssocConst). Previously these would be parsed ambiguously as Binding.

  • The binary assignment operators in BinOp have been renamed to align with the naming used by the standard library's core::ops module's traits. For example BinOp::AddEq is now called BinOp::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 the start and end naming used by the standard library's RangeBounds trait, rather than from/to or lo/hi.

  • Expr::AssignOp has been merged into Expr::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 for for<...> lifetimes.

Statements

  • Variants Stmt::Expr (tail-position expression without trailing semicolon) and Stmt::Semi (non-tail expression with trailing semicolon) have been combined into Stmt::Expr with the optional semicolon represented by Option<Token![;]>.

  • The syntax tree for Stmt::Local has been extended to handle let/else syntax.

  • Macros in statement position are now uniformly parsed as Stmt::Macro. Previously these would be disambiguated to Stmt::Item, although it was ambiguous whether a macro in statement position would expand to an item (like thread_local! { ... }) vs an expression (like println! { ... }).

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) and Pat::parse_multi_with_leading_vert (for the pattern of match arms, which allow an optional leading |). Previously only a single parse behavior was supported and behaved like the new parse_single.

... (truncated)

Commits
  • 906fa56 Release 2.0.0
  • 29bd855 Fix warning about Cargo.toml exclude/include
  • 4788fd9 Emphasize Punctuated's entry in the syn::punctuated module documentation
  • 30287e3 Merge pull request #1405 from dtolnay/attrparse
  • 35cbe6a Demonstrate attr.parse_args_with(Punctuated::<Meta, Token![,]>::parse_termina...
  • 2397e53 Make all attribute parsing examples actually run
  • 7c84b23 Restructure parse_nested_meta example code to be more easily skimmed
  • 334bf8d Merge pull request #1404 from dtolnay/fastattr
  • 6a4e49d Optimize attribute parsing for the overwhelmingly common case
  • 615d66c Delete unneeded test modules from the benchmarks
  • Additional commits viewable in compare view


You can trigger a rebase of this PR 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 merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@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)
> **Note** > Automatic rebases have been disabled on this pull request as it has been open for over 30 days.
dependabot[bot] commented 1 year ago

Dependabot tried to update this pull request, but something went wrong. We're looking into it, but in the meantime you can retry the update by commenting @dependabot rebase.

dependabot[bot] commented 1 year ago

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.