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

Edit rustc_middle::dep_graph module documentation #80325

Closed
wants to merge 2 commits into from
Closed

Edit rustc_middle::dep_graph module documentation #80325

wants to merge 2 commits into from

Conversation

pierwill
Copy link
Member

The first commit here moves the content to mod.rs, the second contains edits.

The section I've called "DepNode creation and 'inference'" appears to have some outdated material. (DepConstructor is a struct, not an enum.)

@rust-highfive
Copy link
Collaborator

r? @estebank

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 23, 2020
@jyn514
Copy link
Member

jyn514 commented Dec 23, 2020

r? @cjgillot

@cjgillot
Copy link
Contributor

You may also want to edit the docs for rustc_query_system::dep_graph::dep_node, which are a copy-paste of those for rustc_middle::dep_graph::dep_node.

@@ -28,8 +30,12 @@
//! could not be instantiated because the current compilation session
//! contained no `DefId` for thing that had been removed.
//!
//! ## `DepNode` creation and "inference"
//!
// Where is the `define_dep_nodes!()` macro?
Copy link
Contributor

Choose a reason for hiding this comment

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

The define_dep_nodes macro is defined in dep_node.rs.
It defines the DepKind enum, and DepConstructor.
DepNode is defined in rustc_query_system::dep_graph::dep_node.

//! `DepNode` definition happens in the `define_dep_nodes!()` macro. This macro
//! defines the `DepKind` enum and a corresponding `DepConstructor` enum. The
//! defines the `DepKind` enum and a corresponding [`DepConstructor`] enum. The
Copy link
Contributor

Choose a reason for hiding this comment

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

Drive-by: DepConstructor should really just be a mod, since all it does is provide a namespace for functions constructing DepNodes.

@@ -50,6 +56,12 @@
//! than a zeroed out fingerprint. More generally speaking, it relieves the
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure the API is that restricted any more. There is an escape hatch DepNode::new_no_params which is used in non-incremental runs.

@jyn514
Copy link
Member

jyn514 commented Dec 24, 2020

You may also want to edit the docs for rustc_query_system::dep_graph::dep_node, which are a copy-paste of those for rustc_middle::dep_graph::dep_node.

Maybe that module should link to rustc_middle instead? Or use doc = include_str! to make sure they're kept in sync?

@jyn514 jyn514 added A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) labels Dec 24, 2020
@bors
Copy link
Contributor

bors commented Jan 8, 2021

☔ The latest upstream changes (presumably #78452) made this pull request unmergeable. Please resolve the merge conflicts.

@jyn514 jyn514 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 Jan 8, 2021
m-ou-se added a commit to m-ou-se/rust that referenced this pull request Jan 14, 2021
…erister

Get rid of `DepConstructor`

This removes fully 235 unused functions.

Follow-up to rust-lang#80325 (comment).

r? `@michaelwoerister`
cc `@cjgillot`
m-ou-se added a commit to m-ou-se/rust that referenced this pull request Jan 14, 2021
…erister

Get rid of `DepConstructor`

This removes fully 235 unused functions.

Follow-up to rust-lang#80325 (comment).

r? ``@michaelwoerister``
cc ``@cjgillot``
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  EXTRA_VARIABLES: {
 "CI_ONLY_WHEN_SUBMODULES_CHANGED": 1
##[endgroup]
adding extra environment variable CI_ONLY_WHEN_SUBMODULES_CHANGED
linux builder detected, using docker to run the build
##[group]Run src/ci/scripts/should-skip-this.sh
---
######################################################################## 100.0%
extracting /checkout/obj/build/cache/2020-11-19/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz
    Updating crates.io index
    Updating git repository `https://github.com/rust-lang/cargo`
    Updating git repository `https://github.com/rust-lang/rustfmt`
error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
If you want to try to generate the lock file without accessing the network, use the --offline flag.
Build completed unsuccessfully in 0:00:41
make: *** [prepare] Error 1
Makefile:60: recipe for target 'prepare' failed
Command failed. Attempt 2/5:
Command failed. Attempt 2/5:
    Updating crates.io index
    Updating git repository `https://github.com/rust-lang/cargo`
    Updating git repository `https://github.com/rust-lang/rustfmt`
error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
If you want to try to generate the lock file without accessing the network, use the --offline flag.
Build completed unsuccessfully in 0:00:01
make: *** [prepare] Error 1
Makefile:60: recipe for target 'prepare' failed
Command failed. Attempt 3/5:
Command failed. Attempt 3/5:
    Updating crates.io index
    Updating git repository `https://github.com/rust-lang/cargo`
    Updating git repository `https://github.com/rust-lang/rustfmt`
error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
If you want to try to generate the lock file without accessing the network, use the --offline flag.
Build completed unsuccessfully in 0:00:00
make: *** [prepare] Error 1
Makefile:60: recipe for target 'prepare' failed
Command failed. Attempt 4/5:
Command failed. Attempt 4/5:
    Updating crates.io index
    Updating git repository `https://github.com/rust-lang/cargo`
    Updating git repository `https://github.com/rust-lang/rustfmt`
error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
If you want to try to generate the lock file without accessing the network, use the --offline flag.
Build completed unsuccessfully in 0:00:00
make: *** [prepare] Error 1
Makefile:60: recipe for target 'prepare' failed
Command failed. Attempt 5/5:
Command failed. Attempt 5/5:
    Updating crates.io index
    Updating git repository `https://github.com/rust-lang/cargo`
    Updating git repository `https://github.com/rust-lang/rustfmt`
error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
If you want to try to generate the lock file without accessing the network, use the --offline flag.
Build completed unsuccessfully in 0:00:00
make: *** [prepare] Error 1
Makefile:60: recipe for target 'prepare' failed
The command has failed after 5 attempts.

@pierwill
Copy link
Member Author

Not at all sure I did this rebase correctly... 🤔

@bors
Copy link
Contributor

bors commented Jan 17, 2021

☔ The latest upstream changes (presumably #81093) made this pull request unmergeable. Please resolve the merge conflicts.

@pierwill pierwill closed this Jan 17, 2021
@pierwill pierwill deleted the rustcmiddle-depgraph-docs branch February 17, 2021 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants