-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
HIR analysis: Remove unnecessary abstraction over list of clauses #137100
Conversation
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 closure is dissatisfying but that's basically the only qualm i have here; i think it's fine anyways. you can further simplify it if you want, but if not then r=me
This comment has been minimized.
This comment has been minimized.
Looks like we should add those const trait checks back, or possibly alternatively just suppress host effect predicates for traits that aren't const. |
b719f28
to
84bdc5d
Compare
So in I've now split the predicate filtering logic to handle predicates and const conditions in two separate steps. This allowed me to (1) inline the closure and to (2) gate adding const condition behind the necessary validation step. |
Oh yeah that's much nicer |
@bors r+ rollup |
…, r=compiler-errors HIR analysis: Remove unnecessary abstraction over list of clauses `rustc_hir_analysis::bounds::Bounds` with its methods is nowadays a paper-thin wrapper around `Vec<(Clause, Span)>`s and `Vec::push` essentially. Its existence slightly annoyed me (and I keep opening its corresp. file instead of the identically named `bounds.rs` in `hir_ty_lowering/` that I actually want most of the time :P). Opening to check if you agree with inlining it. r? compiler-errors or reassign
…kingjubilee Rollup of 12 pull requests Successful merges: - rust-lang#136671 (Overhaul `rustc_middle::limits`) - rust-lang#136817 (Pattern Migration 2024: clean up and comment) - rust-lang#136844 (Use `const_error!` when possible) - rust-lang#136953 (rustc_target: import TargetMetadata) - rust-lang#137095 (Replace some u64 hashes with Hash64) - rust-lang#137100 (HIR analysis: Remove unnecessary abstraction over list of clauses) - rust-lang#137105 (Restrict DerefPure for Cow<T> impl to T = impl Clone, [impl Clone], str.) - rust-lang#137120 (Enable `relative-path-include-bytes-132203` rustdoc-ui test on Windows) - rust-lang#137125 (Re-add missing empty lines in the releases notes) - rust-lang#137140 (Fix const items not being allowed to be called `r#move` or `r#static`) - rust-lang#137145 (use add-core-stubs / minicore for a few more tests) - rust-lang#137149 (Remove SSE ABI from i586-pc-windows-msvc) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#137095 (Replace some u64 hashes with Hash64) - rust-lang#137100 (HIR analysis: Remove unnecessary abstraction over list of clauses) - rust-lang#137105 (Restrict DerefPure for Cow<T> impl to T = impl Clone, [impl Clone], str.) - rust-lang#137120 (Enable `relative-path-include-bytes-132203` rustdoc-ui test on Windows) - rust-lang#137125 (Re-add missing empty lines in the releases notes) - rust-lang#137145 (use add-core-stubs / minicore for a few more tests) - rust-lang#137149 (Remove SSE ABI from i586-pc-windows-msvc) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#137100 - fmease:hirtylow-rm-clauses-wrapper, r=compiler-errors HIR analysis: Remove unnecessary abstraction over list of clauses `rustc_hir_analysis::bounds::Bounds` with its methods is nowadays a paper-thin wrapper around `Vec<(Clause, Span)>`s and `Vec::push` essentially. Its existence slightly annoyed me (and I keep opening its corresp. file instead of the identically named `bounds.rs` in `hir_ty_lowering/` that I actually want most of the time :P). Opening to check if you agree with inlining it. r? compiler-errors or reassign
rustc_hir_analysis::bounds::Bounds
with its methods is nowadays a paper-thin wrapper aroundVec<(Clause, Span)>
s andVec::push
essentially.Its existence slightly annoyed me (and I keep opening its corresp. file instead of the identically named
bounds.rs
inhir_ty_lowering/
that I actually want most of the time :P).Opening to check if you agree with inlining it.
r? compiler-errors or reassign