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

custom_mir: change Call() terminator syntax to something more readable #115000

Merged
merged 1 commit into from
Aug 20, 2023

Conversation

RalfJung
Copy link
Member

I find our current syntax very hard to read -- I cannot even remember the order of arguments, and having the "next block" before the actual function call is very counter-intuitive IMO. So I suggest we use Call(ret_val = function(v), next_block) instead.

r? @JakobDegen

@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 19, 2023
@rustbot
Copy link
Collaborator

rustbot commented Aug 19, 2023

The Miri subtree was changed

cc @rust-lang/miri

@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

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

this is way more readable ❤️

r=me unless you want a review from jakob :)

@RalfJung
Copy link
Member Author

One review seems good enough, thanks. :)
@cbeuw heads-up, your fuzzer is going to need adjusting for this.

I've squashed the two commits.
@bors r=compiler-errors

@bors
Copy link
Contributor

bors commented Aug 19, 2023

📌 Commit 3c6447ca83a45c9b113dc31a2ddb5323f0767260 has been approved by compiler-errors

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 Aug 19, 2023
@@ -275,7 +276,7 @@ define!("mir_return", fn Return() -> BasicBlock);
define!("mir_goto", fn Goto(destination: BasicBlock) -> BasicBlock);
define!("mir_unreachable", fn Unreachable() -> BasicBlock);
define!("mir_drop", fn Drop<T>(place: T, goto: BasicBlock));
define!("mir_call", fn Call<T>(place: T, goto: BasicBlock, call: T));
define!("mir_call", fn Call<T>(call: T, goto: BasicBlock));
Copy link
Contributor

Choose a reason for hiding this comment

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

The type of the first argument should be () I believe

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah right, I forgot that assignments have type () in Rust.

@RalfJung

This comment was marked as outdated.

@bors

This comment was marked as outdated.

@bors

This comment was marked as outdated.

@RalfJung
Copy link
Member Author

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 19, 2023
@RalfJung
Copy link
Member Author

@bors r=compiler-errors,JakobDegen

@bors
Copy link
Contributor

bors commented Aug 19, 2023

📌 Commit 7a63466 has been approved by compiler-errors,JakobDegen

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 19, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 20, 2023
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#114834 (Avoid side-effects from `try_coerce` when suggesting borrowing LHS of cast)
 - rust-lang#114968 (Fix UB in `std::sys::os::getenv()`)
 - rust-lang#114976 (Ignore unexpected incr-comp session dirs)
 - rust-lang#114999 (Migrate GUI colors test to original CSS color format)
 - rust-lang#115000 (custom_mir: change Call() terminator syntax to something more readable)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2bca4b5 into rust-lang:master Aug 20, 2023
11 checks passed
@rustbot rustbot added this to the 1.73.0 milestone Aug 20, 2023
@RalfJung RalfJung deleted the custom-mir-call branch August 20, 2023 13:54
cbeuw added a commit to cbeuw/rustlantis that referenced this pull request Aug 21, 2023
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. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants