-
Notifications
You must be signed in to change notification settings - Fork 155
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
Upgrade to syn 2.0 #442
Upgrade to syn 2.0 #442
Conversation
✅ Deploy Preview for salsa-rs canceled.
|
This compiles, but doesn't work because of a run-time breaking change in
|
CC @fee1-dead maybe you ran into this before (I noticed you've filed PRs against various projects)? |
let name = attr.path.segments[1].ident.to_string(); | ||
let tts = attr.tokens.into(); | ||
let name = attr.path().segments[1].ident.to_string(); | ||
let tts = attr.into_token_stream().into(); |
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.
Doesn't this return the entire attribute? Previously tokens
were the tokens that are not the path e.g. (foo)
in #[salsa::something(foo)]
.
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.
Yeah, that's probably it. I looked at the MetaList
in attr.meta
, but couldn't really make it work, probably because that still includes the path.
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.
The MetaList
works differently. It doesn't have the path, but it doesn't have the parenthesis either. So you would have foo
. You could probably quote!
this and wrap the result around parentheses as a dirty hack.
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.
This is actually working now AFAICT, it fails to build because of some Span
/DelimSpan
changes.
da16ee5
to
069b114
Compare
Would be nice if we could land #443 here as well should we cut another pre-release for old salsa (I don't think syn 2 demands changes for that PR) |
I think you could just use the |
Thanks, that leaves this bit here, where |
Try using the |
actually wait nvm. you wanted to create a paren token |
Ah, I think you can should still be able to call |
Thanks, this was such a struggle 😔. |
Hi @lnicola -- I apologize for letting this sit for so long. If you are still interested, would you consider rebasing it? If not, I understand. |
I cloned the repository, wanting to rebase this PR, but saw that the macros already use syn 2.0. Therefore there's no need to rebase this now. |
Yup, I guess this is no longer necessary? |
No description provided.