-
Notifications
You must be signed in to change notification settings - Fork 931
Update rustc-ap-syntax #2512
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 rustc-ap-syntax #2512
Conversation
Bump `rustc-ap-syntax` and `rustc-ap-rustc_errors` to `57.0.0`.
With some refactorings to avoid duplicated code.
`ast::Visibility` is changed to `codemap::Spanned` whose node is `ast::VisibilityKind`. This commit fixes it. Closes rust-lang#2398.
`ast::Arm` used to have `beginning_vert` field whose type is `Option<Span>` and holds a span of the beginning `|` if available. This field is now removed. This commit works around that. Since we only need a `BytePos` of the `|`, the type of `beginning_vert` in `ArmWrapper` is `Option<BytePos>`.
I think that we should periodically update |
Yeah, I think that would be good. I would like to update regularly, but leave any new syntax as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks good other than the minor code style query.
src/expr.rs
Outdated
@@ -730,7 +730,7 @@ struct ControlFlow<'a> { | |||
block: &'a ast::Block, | |||
else_block: Option<&'a ast::Expr>, | |||
label: Option<ast::Label>, | |||
pat: Option<&'a ast::Pat>, | |||
pats: Option<Vec<&'a ast::Pat>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to have an Option<Vec<_>>
here? Is there a difference between None
and an empty Vec
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I blindly added Vec
to the previous definition, but a simple Vec<_>
is enough.
Thank you for your review! I have updated the PR to use |
This PR updates
rustc-ap-syntax
to the latest version (currently58.0.0
), and fixes some breaking changes:beginning_vert
field is removed fromast::Arm
.ast::Visibility
is changed toSpanned
.if let
andwhile let
.Closes #2398.
Closes #2511.