Skip to content

Add pretty_terminator to pretty stable-mir#118172

Merged
bors merged 3 commits into
rust-lang:masterfrom
ouz-a:improve_emit_stable1
Nov 28, 2023
Merged

Add pretty_terminator to pretty stable-mir#118172
bors merged 3 commits into
rust-lang:masterfrom
ouz-a:improve_emit_stable1

Conversation

@ouz-a

@ouz-a ouz-a commented Nov 22, 2023

Copy link
Copy Markdown
Contributor

Because we don't have successors in stable_mir this is somewhat lacking but it's better than nothing, also fixed bug(?) with Opaque which printed extra " when we try to print opaqued String.

Edit: Added successors so this covers Terminators as a whole.
r? @celinval

@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 Nov 22, 2023
@rustbot

rustbot commented Nov 22, 2023

Copy link
Copy Markdown
Collaborator

This PR changes Stable MIR

cc @oli-obk, @celinval, @spastorino, @ouz-a

@compiler-errors

Copy link
Copy Markdown
Contributor

Is there a way that we could have some sort of stdout test that shows what the output changes are? Like a small, stable example program that we could have blessed every time the output changes?

@ouz-a

ouz-a commented Nov 22, 2023

Copy link
Copy Markdown
Contributor Author

Is there a way that we could have some sort of stdout test that shows what the output changes are? Like a small, stable example program that we could have blessed every time the output changes?

I was thinking of writing one after couple PRs down the line.

Comment thread compiler/stable_mir/src/mir/body.rs Outdated
Comment thread compiler/stable_mir/src/mir/pretty.rs Outdated
Comment thread compiler/stable_mir/src/mir/pretty.rs Outdated
@ouz-a ouz-a force-pushed the improve_emit_stable1 branch from f594f9f to 8b971ee Compare November 22, 2023 19:29
@celinval

Copy link
Copy Markdown
Contributor

Because we don't have successors in stable_mir this is somewhat lacking but it's better than nothing, also fixed bug(?) with Opaque which printed extra " when we try to print opaqued String.

Can you add successors functions for Terminator and BasicBlock as part of this PR?

@ouz-a ouz-a force-pushed the improve_emit_stable1 branch from 1324363 to b5c782d Compare November 24, 2023 11:48

@celinval celinval left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. I just added a comment regarding the change to SwitchTarget.

It would be nice if we could add a little sanity check for stable-mir files. We could extend the project-stable-mir test infrastructure for now. In that case, I wouldn't do a full match though, to avoid this constantly breaking.

Comment thread compiler/stable_mir/src/mir/body.rs
@bors

bors commented Nov 24, 2023

Copy link
Copy Markdown
Collaborator

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

@ouz-a ouz-a force-pushed the improve_emit_stable1 branch from b5c782d to 39924d8 Compare November 25, 2023 11:26
@ouz-a

ouz-a commented Nov 25, 2023

Copy link
Copy Markdown
Contributor Author

It would be nice if we could add a little sanity check for stable-mir files. We could extend the project-stable-mir test infrastructure for now. In that case, I wouldn't do a full match though, to avoid this constantly breaking.

I'm planning that for soon, in the next PR I'm going to fix projection printing and place printing and then we can have some sort of a reference program where with each change we could generate new output and see how it looks.

@bors

bors commented Nov 25, 2023

Copy link
Copy Markdown
Collaborator

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

@ouz-a ouz-a force-pushed the improve_emit_stable1 branch from 39924d8 to a0d19ec Compare November 25, 2023 19:33
Comment thread compiler/rustc_smir/src/rustc_smir/convert/mir.rs Outdated
Comment thread compiler/rustc_smir/src/rustc_smir/convert/mir.rs
@celinval

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Nov 27, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit 15f9bab has been approved by celinval

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 Nov 27, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 28, 2023
…mpiler-errors

Rollup of 9 pull requests

Successful merges:

 - rust-lang#111133 (Detect Python-like slicing and suggest how to fix)
 - rust-lang#114708 (Allow setting `rla` labels via `rustbot`)
 - rust-lang#117526 (Account for `!` arm in tail `match` expr)
 - rust-lang#118172 (Add `pretty_terminator` to pretty stable-mir)
 - rust-lang#118202 (Added linker_arg(s) Linker trait methods for link-arg to be prefixed "-Wl," for cc-like linker args and not verbatim)
 - rust-lang#118374 (QueryContext: rename try_collect_active_jobs -> collect_active_jobs, change return type from Option<QueryMap> to QueryMap)
 - rust-lang#118381 (rustc_span: Use correct edit distance start length for suggestions)
 - rust-lang#118382 (Address unused tuple struct fields in the compiler)
 - rust-lang#118384 (Address unused tuple struct fields in rustdoc)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7aa513b into rust-lang:master Nov 28, 2023
@rustbot rustbot added this to the 1.76.0 milestone Nov 28, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 28, 2023
Rollup merge of rust-lang#118172 - ouz-a:improve_emit_stable1, r=celinval

Add `pretty_terminator` to pretty stable-mir

~Because we don't have successors in `stable_mir` this is somewhat lacking but it's better than nothing~, also fixed bug(?) with `Opaque` which printed extra `"` when we try to print opaqued `String`.

**Edit**: Added successors so this covers Terminators as a whole.
r? `@celinval`
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.

6 participants