-
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
match lowering: Split off test_candidates
into several functions and improve comments
#121374
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
86944ce
to
893cb76
Compare
test_candidates
into several functions and improve commentstest_candidates
into several functions and improve comments
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.
r=me with or without these addressed
// of the main candidate; but for a test like SwitchInt, we | ||
// may want to add cases based on the candidates that are | ||
debug!("test_candidates: test={:?} match_pair={:?}", test, match_pair); | ||
// Most of the time, the test to perform is simply a function of the main candidate; but for |
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.
Comment doesn't seem to be in the correct place and can probably just be removed.
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.
Feels alright to me, it's trying to explain the need for add_cases_to_X
shenanigans
Co-authored-by: matthewjasper <20113453+matthewjasper@users.noreply.github.com>
Thank you! |
…wjasper match lowering: Split off `test_candidates` into several functions and improve comments The logic of `test_candidates` has three steps: pick a test, sort the candidates, and generate code for everything. So I split it off into three methods. I also ended up reworking the comments that explain the algorithm. In particular I added detailed examples. I removed the digression about rust-lang#29740 because it's no longer relevant to how the code is structured today. r? `@matthewjasper`
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#121343 (Add examples for some methods on slices) - rust-lang#121374 (match lowering: Split off `test_candidates` into several functions and improve comments) - rust-lang#121474 (Ignore compiletest test directive migration commits) - rust-lang#121515 (promotion: don't promote int::MIN / -1) - rust-lang#121530 (Fix incorrect doc of ScopedJoinHandle::is_finished) - rust-lang#121551 (Forbid use of `extern "C-unwind"` inside standard library) - rust-lang#121556 (Use `addr_of!`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#121374 - Nadrieril:factor-explain, r=matthewjasper match lowering: Split off `test_candidates` into several functions and improve comments The logic of `test_candidates` has three steps: pick a test, sort the candidates, and generate code for everything. So I split it off into three methods. I also ended up reworking the comments that explain the algorithm. In particular I added detailed examples. I removed the digression about rust-lang#29740 because it's no longer relevant to how the code is structured today. r? ``@matthewjasper``
The logic of
test_candidates
has three steps: pick a test, sort the candidates, and generate code for everything. So I split it off into three methods.I also ended up reworking the comments that explain the algorithm. In particular I added detailed examples. I removed the digression about #29740 because it's no longer relevant to how the code is structured today.
r? @matthewjasper