-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Break up long function in trait selection error reporting + clean up nearby code #110563
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 up long function in trait selection error reporting + clean up nearby code #110563
Conversation
r? @jackh726 (rustbot has picked a reviewer for you, use r? to override) |
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.
Just noting that a title like "Break up long function in trait selection error reporting" suggest that this PR is doing more than just splitting out one helper function from error reporting, so I wouldn't consider that function's size problem to have been vanquished just yet.
But there's nothing necessarily wrong with this impl, so r=me
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
One nit though |
Good point, I’ll rename it to be more specific. I do plan on putting up more changes (or maybe I should do it all in one go in this PR). |
No preference I guess. If you do plan on working more on this PR, I'd mark this one as waiting-on-author just to make it clear it's not looking for a review yet. |
Sounds good, I’ll just update this same PR tomorrow then @rustbot label +S-waiting-on-author |
52f1e4a
to
035a1b9
Compare
Okay, I split it up a lot more :) I tried to keep most of the |
@rustbot ready |
☔ The latest upstream changes (presumably #96840) made this pull request unmergeable. Please resolve the merge conflicts. |
- Move blocks of code into their own functions - Replace a few function argument types with their type aliases
035a1b9
to
d0d40d2
Compare
This patch creates an enum to replace a nested `Option`.
722fc88
to
55e5a1d
Compare
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.
Maybe this could use some additional simplification but this is a great start. Thanks!
@bors r+ |
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#110563 (Break up long function in trait selection error reporting + clean up nearby code) - rust-lang#110755 ([LLVM17] Adapt to `ExplicitEmulatedTLS` removal.) - rust-lang#110775 (Update books) - rust-lang#110779 (configure.py: add flag for riscv{64,32}gc musl-root) - rust-lang#110782 (Revert panic oom) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Option
.