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 graphviz tweaks #132346

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
Contributor

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
Contributor

bors commented Oct 30, 2024

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

@bors
Copy link
Contributor

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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