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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

nnethercote
Copy link
Contributor

Small cleanups I found while looking closely at this code.

r? @jieyouxu

`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.
@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
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
 Documenting rustc_errors v0.0.0 (/checkout/compiler/rustc_errors)
error[E0658]: linking to associated items of raw pointers is experimental
    --> compiler/rustc_middle/src/mir/syntax.rs:1436:57
     |
1436 |     /// * `Offset` has the same semantics as [`offset`](pointer::offset), except that the second
     |
     = note: see issue #80896 <https://github.com/rust-lang/rust/issues/80896> for more information
     = help: add `#![feature(intra_doc_pointers)]` to the crate attributes to enable
     = note: this compiler was built on 2025-01-08; consider upgrading it if it is out of date
     = note: this compiler was built on 2025-01-08; consider upgrading it if it is out of date
     = note: rustdoc does not allow disambiguating between `*const` and `*mut`, and pointers are unstable until it does
 Documenting rustc_lint_defs v0.0.0 (/checkout/compiler/rustc_lint_defs)
For more information about this error, try `rustc --explain E0658`.
error: could not document `rustc_middle`
warning: build failed, waiting for other jobs to finish...
warning: build failed, waiting for other jobs to finish...
Command has failed. Rerun with -v to see more details.
  local time: Mon Feb  3 06:48:25 UTC 2025
  network time: Mon, 03 Feb 2025 06:48:25 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

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

@@ -47,10 +47,8 @@
#![feature(extract_if)]
#![feature(file_buffered)]
#![feature(if_let_guard)]
#![feature(intra_doc_pointers)]
Copy link
Member

Choose a reason for hiding this comment

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

Might need this because the doc comment uses this?

@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
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-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

4 participants