Skip to content
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

[derive] Simplify code, remove obsolete features #375

Merged

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented Sep 12, 2023

Clean up the implementation, especially in fn impl_block. Make the following notable changes:

  • Previously, syn didn't support parsing macro invocations in const generics without the full feature enabled. To avoid the compile-time overhead of that feature, we worked around it by constructing AST nodes manually. syn has since added support for this without requiring the full feature, so we make use of it.
  • We used to need to split types into those that transatively depended upon type generics (like [T; 2]) and those that didn't (like [u8; 2]). We made a change in Move field type bounds into where clauses #119 that made this distinction irrelevant, but we never removed the code to perform the split. In this commit, we remove that code. That code was the only reason we needed to enable syn's visit feature, so we are also able to remove that feature dependency.

Clean up the implementation, especially in `fn impl_block`. Make the
following notable changes:
- Previously, `syn` didn't support parsing macro invocations in const
  generics without the `full` feature enabled. To avoid the compile-time
  overhead of that feature, we worked around it by constructing AST
  nodes manually. `syn` has since added support for this without
  requiring the `full` feature, so we make use of it.
- We used to need to split types into those that transatively depended
  upon type generics (like `[T; 2]`) and those that didn't (like
  `[u8; 2]`). We made a change in #119 that made this distinction
  irrelevant, but we never removed the code to perform the split. In
  this commit, we remove that code. That code was the only reason we
  needed to enable `syn`'s `visit` feature, so we are also able to
  remove that feature dependency.
@joshlf joshlf requested a review from djkoloski September 12, 2023 15:46
@joshlf joshlf merged commit 04c5363 into main Sep 12, 2023
@joshlf joshlf deleted the try-from-bytes-raw-argument-to-is-bit-valid--derive-cleanup branch September 12, 2023 16:46
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.

2 participants