-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Fix double handling in collect_tokens
#129346
Fix double handling in collect_tokens
#129346
Conversation
The last three commits are tricky and hard to review. Even after multiple weeks of working with this code, I still find it hard to understand and reason about, and I wish it could be made simpler. But the good news is that these commits are enough to the get final failing test ( |
This comment has been minimized.
This comment has been minimized.
a0f9bfd
to
7d65809
Compare
I think this should get a crater run, just because I don't fully trust that the test suite is thoroughly testing And why not do a perf run, just to check there's no regressions. @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…ollect_tokens, r=<try> Fix double handling in `collect_tokens` Double handling of AST nodes can occur in `collect_tokens`. This is when an inner call to `collect_tokens` produces an AST node, and then an outer call to `collect_tokens` produces the same AST node. This can happen in a few places, e.g. expression statements where the statement delegates `HasTokens` and `HasAttrs` to the expression. It will also happen more after rust-lang#124141. This PR fixes some double handling cases that cause problems, including rust-lang#129166. r? `@petrochenkov`
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (8b22b49): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (secondary -2.7%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary -2.3%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (secondary 0.0%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 748.876s -> 749.555s (0.09%) |
Which change is a source of the perf regression, 7d65809 probably? |
I'll start crater once #129346 (comment) is addressed and CI is green. |
7d65809
to
aeaa62b
Compare
I have adding a commit that avoids cloning Let's see what the new status is: |
…ollect_tokens, r=<try> Fix double handling in `collect_tokens` Double handling of AST nodes can occur in `collect_tokens`. This is when an inner call to `collect_tokens` produces an AST node, and then an outer call to `collect_tokens` produces the same AST node. This can happen in a few places, e.g. expression statements where the statement delegates `HasTokens` and `HasAttrs` to the expression. It will also happen more after rust-lang#124141. This PR fixes some double handling cases that cause problems, including rust-lang#129166. r? `@petrochenkov`
☀️ Try build successful - checks-actions |
@rust-timer build a70947b |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (a70947b): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (primary -0.8%, secondary 2.4%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary 2.3%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (secondary -0.1%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 750.761s -> 751.313s (0.07%) |
…ollect_tokens, r=<try> Fix double handling in `collect_tokens` Double handling of AST nodes can occur in `collect_tokens`. This is when an inner call to `collect_tokens` produces an AST node, and then an outer call to `collect_tokens` produces the same AST node. This can happen in a few places, e.g. expression statements where the statement delegates `HasTokens` and `HasAttrs` to the expression. It will also happen more after rust-lang#124141. This PR fixes some double handling cases that cause problems, including rust-lang#129166. r? `@petrochenkov`
☀️ Try build successful - checks-actions |
@craterbot check |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
The reason that I really wish that multiple |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
No genuine regressions in the crater run. @petrochenkov, are you happy for it to merge? |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (6d05f12): comparison URL. Overall result: ❌✅ regressions and improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (primary -1.9%, secondary 1.9%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 754.658s -> 756.515s (0.25%) |
FWIW, this did regress the following test: https://docs.rs/crate/cfg_eval/0.1.2/source/tests/item.rs I don't know why crater did not see it 😔 |
struct Foo { | ||
val: [bool; { | ||
let a = #[cfg_attr(not(FALSE), rustc_dummy(first))] $expr; | ||
0 | ||
}] | ||
} |
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 case stopped working?
even if crater found your crate, it was only a check run |
Double handling of AST nodes can occur in
collect_tokens
. This is when an inner call tocollect_tokens
produces an AST node, and then an outer call tocollect_tokens
produces the same AST node. This can happen in a few places, e.g. expression statements where the statement delegatesHasTokens
andHasAttrs
to the expression. It will also happen more after #124141.This PR fixes some double handling cases that cause problems, including #129166.
r? @petrochenkov