-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Break tokens before checking if they are 'probably equal' #72306
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 84b0397805132b435699c525b91cfcb5f1bf7c3a with merge f24b9a57e2c4ea08ca739037ce291dbd3e2e2708... |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
☀️ Try build successful - checks-azure |
Queued f24b9a57e2c4ea08ca739037ce291dbd3e2e2708 with parent d79f1bd, future comparison URL. |
Finished benchmarking try commit f24b9a57e2c4ea08ca739037ce291dbd3e2e2708, comparison URL. |
Fixes rust-lang#68489 When checking two `TokenStreams` to see if they are 'probably equal', we ignore the `IsJoint` information associated with each `TokenTree`. However, the `IsJoint` information determines whether adjacent tokens will be 'glued' (if possible) when construction the `TokenStream` - e.g. `[Gt Gt]` can be 'glued' to `BinOp(Shr)`. Since we are ignoring the `IsJoint` information, 'glued' and 'unglued' tokens are equivalent for determining if two `TokenStreams` are 'probably equal'. Therefore, we need to 'unglue' all tokens in the stream to avoid false negatives (which cause us to throw out the cached tokens, losing span information).
84b0397
to
a3e7825
Compare
Some tokens need to be broken in a loop until we reach 'unbreakable' tokens.
a3e7825
to
4a8ccdc
Compare
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Yeah, let's pile up hacks on top of hacks so the hack mountain obscures the Sun. |
📌 Commit 4a8ccdc has been approved by |
🌲 The tree is currently closed for pull requests below priority 9000, this pull request will be tested once the tree is reopened |
Wait, from the prettified log it looked like the CI failure was spurious, but it is not. r=me with green CI |
@petrochenkov: Fixed |
…petrochenkov Break tokens before checking if they are 'probably equal' Fixes rust-lang#68489 Fixes rust-lang#70987 When checking two `TokenStreams` to see if they are 'probably equal', we ignore the `IsJoint` information associated with each `TokenTree`. However, the `IsJoint` information determines whether adjacent tokens will be 'glued' (if possible) when construction the `TokenStream` - e.g. `[Gt Gt]` can be 'glued' to `BinOp(Shr)`. Since we are ignoring the `IsJoint` information, 'glued' and 'unglued' tokens are equivalent for determining if two `TokenStreams` are 'probably equal'. Therefore, we need to 'unglue' all tokens in the stream to avoid false negatives (which cause us to throw out the cached tokens, losing span information).
@bors try @rust-timer queue |
🙅 Please do not |
Awaiting bors try build completion |
@bors r- |
Awaiting bors try build completion |
⌛ Trying commit 633293f with merge ede22bd73291f6dfc8c10cd9a59926946698b987... |
☀️ Try build successful - checks-azure |
Queued ede22bd73291f6dfc8c10cd9a59926946698b987 with parent 06c9fef, future comparison URL. |
Finished benchmarking try commit ede22bd73291f6dfc8c10cd9a59926946698b987, comparison URL. |
@petrochenkov: There appears to be no perf impact |
@bors r+ |
📌 Commit 633293f has been approved by |
Rollup of 4 pull requests Successful merges: - rust-lang#71610 (InvalidUndefBytes: Track size of undef region used) - rust-lang#72161 (Replace fcntl-based file lock with flock) - rust-lang#72306 (Break tokens before checking if they are 'probably equal') - rust-lang#72325 (Always generated object code for `#![no_builtins]`) Failed merges: r? @ghost
Fixes #68489
Fixes #70987
When checking two
TokenStreams
to see if they are 'probably equal',we ignore the
IsJoint
information associated with eachTokenTree
.However, the
IsJoint
information determines whether adjacent tokenswill be 'glued' (if possible) when construction the
TokenStream
- e.g.[Gt Gt]
can be 'glued' toBinOp(Shr)
.Since we are ignoring the
IsJoint
information, 'glued' and 'unglued'tokens are equivalent for determining if two
TokenStreams
are'probably equal'. Therefore, we need to 'unglue' all tokens in the
stream to avoid false negatives (which cause us to throw out the cached
tokens, losing span information).