Skip to content

Incorporate iter_nodes into graph::DirectedGraph #136082

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

Zalathar
Copy link
Contributor

This helper method iterates over all node IDs in the dense range 0..num_nodes.

In practice, we have a lot of graph-algorithm code that already assumes that nodes are densely numbered, by using num_nodes to allocate per-node indexed data structures. So I don't think this is actually a substantial change to the de-facto semantics of graph::DirectedGraph.


Resolves a FIXME from #135481.

This assumes that the set of valid node IDs is exactly `0..num_nodes`.

In practice, we have a lot of graph-algorithm code that already assumes that
nodes are densely numbered, by using `num_nodes` to allocate per-node indexed
data structures.
@rustbot
Copy link
Collaborator

rustbot commented Jan 26, 2025

r? @fmease

rustbot has assigned @fmease.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added 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 Jan 26, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jan 26, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@oli-obk
Copy link
Contributor

oli-obk commented Jan 27, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 27, 2025

📌 Commit d36e2b8 has been approved by oli-obk

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-review Status: Awaiting review from the assignee but also interested parties. labels Jan 27, 2025
@oli-obk oli-obk assigned oli-obk and unassigned fmease Jan 27, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 27, 2025
…llaumeGomez

Rollup of 10 pull requests

Successful merges:

 - rust-lang#135773 (Clarify WindowsMut (Lending)Iterator)
 - rust-lang#135807 (Implement phantom variance markers)
 - rust-lang#135876 (fix doc for std::sync::mpmc)
 - rust-lang#135988 (Add a workaround for parallel rustc crashing when there are delayed bugs)
 - rust-lang#136037 (Mark all NuttX targets as tier 3 target and support the standard library)
 - rust-lang#136064 (Add a suggestion to cast target_feature fn items to fn pointers.)
 - rust-lang#136082 (Incorporate `iter_nodes` into `graph::DirectedGraph`)
 - rust-lang#136112 (Clean up all dead files inside `tests/ui/`)
 - rust-lang#136114 (Use identifiers more in diagnostics code)
 - rust-lang#136118 (Change `collect_and_partition_mono_items` tuple return type to a struct)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f29979a into rust-lang:master Jan 27, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 27, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 27, 2025
Rollup merge of rust-lang#136082 - Zalathar:iter-nodes, r=oli-obk

Incorporate `iter_nodes` into `graph::DirectedGraph`

This helper method iterates over all node IDs in the dense range `0..num_nodes`.

In practice, we have a lot of graph-algorithm code that already assumes that nodes are densely numbered, by using `num_nodes` to allocate per-node indexed data structures. So I don't think this is actually a substantial change to the de-facto semantics of `graph::DirectedGraph`.

---

Resolves a FIXME from rust-lang#135481.
@Zalathar Zalathar deleted the iter-nodes branch January 27, 2025 21:32
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
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