Skip to content
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

Some rustc_middle cleanups #136465

Merged
merged 8 commits into from
Feb 4, 2025
Merged

Conversation

nnethercote
Copy link
Contributor

Small cleanups I found while looking closely at this code.

r? @jieyouxu

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 3, 2025
@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, one nit, but otherwise LGTM

@jieyouxu jieyouxu added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 3, 2025
`rustc_middle` and `rustc_query_system` both have a file called
`dep_node.rs` with a big comment at the top, and the comments are very
similar. The one in `rustc_query_system` looks like the original, and
the one in `rustc_middle` is a copy with some improvements.

This commit removes the comment from `rustc_middle` and updates the one
in `rustc_query_system` to include the improvements. I did it this way
because `rustc_query_system` is the crate that defines `DepNode`, and so
seems like the right place for the comment.
The same comments are on the `DepNodeExt` trait and the single impl of
that trait, immediately below. This commit eliminates the duplication.
It has a single call site and removing it makes the code simpler.
Perhaps there were more uses at some point in the past?
The `field_name`/`field_ty` don't need to be parameters, they can be
hardcoded.
- Mention THIR.
- Removed mentions of non-existent READMEs.
I *think* this addresses what the `FIXME` comments are asking for.
@nnethercote
Copy link
Contributor Author

@bors r=jieyouxu

@bors
Copy link
Contributor

bors commented Feb 4, 2025

📌 Commit d8d6128 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 4, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 4, 2025
Rollup of 6 pull requests

Successful merges:

 - rust-lang#136398 (add UnsafeCell direct access APIs)
 - rust-lang#136465 (Some `rustc_middle` cleanups)
 - rust-lang#136479 (std::fs: further simplify dirent64 handling)
 - rust-lang#136504 (Fix last compare-mode false negatives in tests)
 - rust-lang#136511 (Add `cast_signed` and `cast_unsigned` methods for `NonZero` types)
 - rust-lang#136518 (Add note about `FnPtr` trait being exposed as public bound)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 87af17c into rust-lang:master Feb 4, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Feb 4, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 4, 2025
Rollup merge of rust-lang#136465 - nnethercote:rustc_middle-MORE, r=jieyouxu

Some `rustc_middle` cleanups

Small cleanups I found while looking closely at this code.

r? `@jieyouxu`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants