-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Conversation
The Miri subtree was changed cc @rust-lang/miri |
This comment has been minimized.
This comment has been minimized.
51b5b03
to
3e4d907
Compare
There was a problem hiding this 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 :)
3e4d907
to
3c6447c
Compare
📌 Commit 3c6447ca83a45c9b113dc31a2ddb5323f0767260 has been approved by It is now in the queue for this repository. |
library/core/src/intrinsics/mir.rs
Outdated
@@ -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)); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@bors r- |
3c6447c
to
7a63466
Compare
@bors r=compiler-errors,JakobDegen |
…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
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