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

Add pretty_terminator to pretty stable-mir #118172

Merged
merged 3 commits into from
Nov 28, 2023

Conversation

ouz-a
Copy link
Contributor

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

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
Copy link
Collaborator

rustbot commented Nov 22, 2023

This PR changes Stable MIR

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

@compiler-errors
Copy link
Member

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
Copy link
Contributor Author

ouz-a commented Nov 22, 2023

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.

compiler/stable_mir/src/mir/body.rs Outdated Show resolved Hide resolved
compiler/stable_mir/src/mir/pretty.rs Outdated Show resolved Hide resolved
compiler/stable_mir/src/mir/pretty.rs Outdated Show resolved Hide resolved
@celinval
Copy link
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?

Copy link
Contributor

@celinval celinval left a comment

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.

compiler/stable_mir/src/mir/body.rs Show resolved Hide resolved
@bors
Copy link
Contributor

bors commented Nov 24, 2023

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

@ouz-a
Copy link
Contributor Author

ouz-a commented Nov 25, 2023

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
Copy link
Contributor

bors commented Nov 25, 2023

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

@celinval
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 27, 2023

📌 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
11 checks passed
@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