rustc_hir_analysis cleanups#136281
Merged
bors merged 14 commits intorust-lang:masterfrom Jan 31, 2025
Merged
Conversation
Collaborator
|
HIR ty lowering was modified cc @fmease |
6f96e70 to
b75d37c
Compare
fmease
reviewed
Jan 30, 2025
lcnr
reviewed
Jan 30, 2025
Contributor
|
r=me after nit for everything outside of df90ba0 I personally don't think reflowing comments is worth it as it results in merge conflicts for little benefit, e.g. the changes to
will conflict with #135899. |
Collaborator
|
☔ The latest upstream changes (presumably #134824) made this pull request unmergeable. Please resolve the merge conflicts. |
I was confused here for a bit.
Also rewrite the merged arm slightly to more closely match the arm above it.
This comment made sense when this crate was called `rustc_typeck`, but makes less sense now that it's called `rustc_hir_analysis`. Especially given that `check_drop_impl` is only called within the crate.
Note: `inherit_predicates_for_delegation_item` already has these cases merged.
There is a comment `Delegation to inherent methods is not yet supported.` that appears three times mid-pattern and somehow inhibits rustfmt from formatting the enclosing `match` statement. This commit moves them to the top of the pattern, which enables more formatting.
`delegation.rs` has three builders: `GenericsBuilder`, `PredicatesBuilder`, and `GenericArgsBuilder`. The first two builders have just two optional parameters, and the third one has zero. Each builder is used within a single function. The code is over-engineered. This commit removes the builders, replacing each with with a single `build_*` function. This makes the code shorter and simpler.
It used to be bigger, with an `Xform` trait, but now it has just a single function.
b75d37c to
d58d674
Compare
Instead re-export `rustc_hir_analysis::collect::suggest_impl_trait`, which is the only thing from the module used in another crate. This fixes a `FIXME` comment. Also adjust some visibilities to satisfy the `unreachable_pub` lint. This changes requires downgrading a link in a comment on `FnCtxt` because `collect` is no longer public and rustdoc complains otherwise. This is annoying but I can't see how to avoid it.
d58d674 to
483307f
Compare
Contributor
Author
|
I removed the comment reflows. @bors r=lcnr |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 31, 2025
Rollup of 9 pull requests Successful merges: - rust-lang#132156 (When encountering unexpected closure return type, point at return type/expression) - rust-lang#133429 (Autodiff Upstreaming - rustc_codegen_ssa, rustc_middle) - rust-lang#136281 (`rustc_hir_analysis` cleanups) - rust-lang#136297 (Fix a typo in profile-guided-optimization.md) - rust-lang#136300 (atomic: extend compare_and_swap migration docs) - rust-lang#136310 (normalize `*.long-type.txt` paths for compare-mode tests) - rust-lang#136312 (Disable `overflow_delimited_expr` in edition 2024) - rust-lang#136313 (Filter out RPITITs when suggesting unconstrained assoc type on too many generics) - rust-lang#136323 (Fix a typo in conventions.md) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 31, 2025
Rollup merge of rust-lang#136281 - nnethercote:rustc_hir_analysis, r=lcnr `rustc_hir_analysis` cleanups Just some improvements I found while looking through this code. r? `@lcnr`
github-actions bot
pushed a commit
to tautschnig/verify-rust-std
that referenced
this pull request
Mar 11, 2025
Rollup of 9 pull requests Successful merges: - rust-lang#132156 (When encountering unexpected closure return type, point at return type/expression) - rust-lang#133429 (Autodiff Upstreaming - rustc_codegen_ssa, rustc_middle) - rust-lang#136281 (`rustc_hir_analysis` cleanups) - rust-lang#136297 (Fix a typo in profile-guided-optimization.md) - rust-lang#136300 (atomic: extend compare_and_swap migration docs) - rust-lang#136310 (normalize `*.long-type.txt` paths for compare-mode tests) - rust-lang#136312 (Disable `overflow_delimited_expr` in edition 2024) - rust-lang#136313 (Filter out RPITITs when suggesting unconstrained assoc type on too many generics) - rust-lang#136323 (Fix a typo in conventions.md) r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Just some improvements I found while looking through this code.
r? @lcnr