-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Encode ident rawness and literal kind separately in tt::Leaf #17559
Conversation
TokenTree
closer to rustc/proc_macro's token tree/stream
f931616
to
0be9e2a
Compare
TokenTree
closer to rustc/proc_macro's token tree/streama860709
to
98e15d4
Compare
@lnicola this PR is now blocked on us syncing with rust-lang/rust as this touches the proc-macro stuff causing CI to run on nightly 😬 so would be nice if we could do a sync by next week, the PR isn't finished yet and once it is I will only merge it at the start of the week. Just letting you know :) |
Yup, will do one soon! |
☔ The latest upstream changes (presumably #17584) made this pull request unmergeable. Please resolve the merge conflicts. |
|
||
pub const CURRENT_API_VERSION: u32 = RUST_ANALYZER_SPAN_SUPPORT; | ||
pub const CURRENT_API_VERSION: u32 = EXTENDED_LEAF_DATA; |
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.
We should be able to start dropping support for some proc-macro server API versions soon should the code here become too complicated.
I reckon this PR will break stuff, will install the modified proc-macro server and use that for the week to see if something is breaking there as well |
@bors r+ |
☀️ Test successful - checks-actions |
Fix incorrect encoding of literals in the proc-macro-api on version 4 Quick follow up on #17559 breaking things
/// Whether literals encode their kind as an additional u32 field and idents their rawness as a u32 field | ||
pub const EXTENDED_LEAF_DATA: u32 = 5; |
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.
Headsup @vlad20012, this PR and #17601 make changes to the proc-macro server API adding a new version, adding two more u32s to literals on the wire, and one more u32 to idents. I have not really given this much thought tbf so please comment if you think we can do better than that. Its not set in stone until the next sync to rustc which will update the proc-macro server then.
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.
Note that syncs are currently on hold until we figure out the new rustc_pattern_analysis
story.
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.
that's fine, probably better even as it gives me more time to test the proc-macro server :D
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.
@Veykril Thanks for mentioning! The changes looks good to me
/// pretty-printing of `TokenStream`'s produced by other means (i.e. parsed | ||
/// source code, internally constructed token streams, and token streams | ||
/// produced by declarative macros). | ||
JointHidden, |
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 changes in Spacing seems unrelated to the wire changes 🤔
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.
Yes that is not yet used, and iirc it won't ever make it to the proc-macro server either so you should be safe to ignore that. For you only the changes in proc-macro-api ought to be really relevant.
@Veykril did you mean to break |
Ah no I didn't |
minor: Make xtask install work again CC #17559 (comment)
Fix incorrect encoding of literals in the proc-macro-api on version 4 Quick follow up on rust-lang/rust-analyzer#17559 breaking things
minor: Make xtask install work again CC rust-lang/rust-analyzer#17559 (comment)
minor: Make xtask install work again CC rust-lang/rust-analyzer#17559 (comment)
No description provided.