Skip to content

Some graphviz tweaks #132346

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 3 commits into from
Oct 30, 2024
Merged

Some graphviz tweaks #132346

merged 3 commits into from
Oct 30, 2024

Conversation

nnethercote
Copy link
Contributor

@nnethercote nnethercote commented Oct 30, 2024

Because it's a `ResultsCursor`, not a `Results`. I find this easier to
read and understand.
`Formatter` currently has a `RefCell<Option<Results>>` field. This is so
the `Results` can be temporarily taken and put into a `ResultsCursor`
that is used by `BlockFormatter`, and then put back, which is messy.

This commit changes `Formatter` to have a `RefCell<ResultsCursor>` and
`BlockFormatter` to have a `&mut ResultsCursor`, which greatly
simplifies the code at the `Formatter`/`BlockFormatter` interaction
point in `Formatter::node_label`. It also means we construct a
`ResultsCursor` once per `Formatter`, instead of once per `node_label`
call.

The commit also:
- documents the reason for the `RefCell`;
- adds a `Formatter::body` method, replacing the `Formatter::body`
  field.
Instead of appending an empty label. Because it's conceptually simpler.
@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 Oct 30, 2024
@rustbot rustbot assigned cjgillot and unassigned lcnr Oct 30, 2024
@rust-lang rust-lang deleted a comment from rustbot Oct 30, 2024
@rust-lang rust-lang deleted a comment from rustbot Oct 30, 2024
Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

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

idk if u want @cjgillot to look at this as well

@nnethercote
Copy link
Contributor Author

One r+ is enough, thanks!

@bors r=lcnr rollup

@bors
Copy link
Collaborator

bors commented Oct 30, 2024

📌 Commit d921be9 has been approved by lcnr

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 Oct 30, 2024
@cjgillot
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Oct 30, 2024

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Collaborator

bors commented Oct 30, 2024

📌 Commit d921be9 has been approved by cjgillot

It is now in the queue for this repository.

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 30, 2024
Rollup of 6 pull requests

Successful merges:

 - rust-lang#130098 (Reject generic self types.)
 - rust-lang#131096 (rustdoc: Remove usage of `allow(unused)` attribute on `no_run` merged doctests)
 - rust-lang#132315 (compiletest: improve robustness of LLVM version handling)
 - rust-lang#132346 (Some graphviz tweaks)
 - rust-lang#132359 (Fix AIX libc call char type from i8 to u8)
 - rust-lang#132360 (Un-vacation myself)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 18e44f8 into rust-lang:master Oct 30, 2024
6 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Oct 30, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 30, 2024
Rollup merge of rust-lang#132346 - nnethercote:some-graphviz-tweaks, r=cjgillot

Some graphviz tweaks

r? `@cjgillot`
@nnethercote nnethercote deleted the some-graphviz-tweaks branch October 30, 2024 21:24
nnethercote added a commit to nnethercote/rust that referenced this pull request Apr 22, 2025
Instead of `ResultsCursor`.

This partly undoes the second commit from rust-lang#132346; possible because
`Results::as_result_cursor` (which doesn't consume the `Results`) is now
available. Delaying the `ResultsCursor` construction will facilitate the
next couple of commits.
ChrisDenton added a commit to ChrisDenton/rust that referenced this pull request Apr 23, 2025
…, r=compiler-errors

Some more graphviz tweaks

A follow-up to rust-lang#132346.

r? `@davidtwco`
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 23, 2025
Rollup merge of rust-lang#140142 - nnethercote:some-graphviz-tweaks-2, r=compiler-errors

Some more graphviz tweaks

A follow-up to rust-lang#132346.

r? `@davidtwco`
# 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