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
Added "copy" to Debug fmt for copy operands #122551
base: master
Are you sure you want to change the base?
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pnkfelix (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
The job Click to see the possible cause of the failure (guessed by this bot)
|
I'm not sure this adds any actual value; the people who are reading the MIR output probably are already well aware of the semantics here? But maybe making the pretty-printing line up has value. I certainly have valued assembly languages that chose the same number of letters in their opcodes (or at least a small upper bound to their lengh) for this exact reason. Who are the people who would care most about whether or not to make this change? The people in @rust-lang/wg-mir-opt ? |
I think this adds value. MIR is read by both MIR experts and non-expert users, and unless a non-experts reads the rustc pretty-printing code, or they reason by elimination, or someone teaches them that non-marked operands are always If anything, not marking the |
I'm moderately in favor of this. I think even tho it's obvious to me I'dve benefited from it when the difference was especially important. let's leave this open for a week to let other @rust-lang/wg-mir-opt folk chime in. If there are no explanations of why we should keep the status quo or do something else entirely in that week, let's bless everything and land it. |
LGTM. But do we also need to update |
In MIR's debug mode (--emit mir) the printing for Operands is slightly inconsistent.
The RValues - values on the right side of an Assign - are usually printed with their Operand when they are Places.
Example:
_2 = move _3
But for arguments, the operand is omitted.
_2 = _1
I propose a change be made, to display the place with the operand.
_2 = copy _1
Move and copy have different semantics, meaning this difference is important and helpful to the user. It also adds consistency to the pretty printing.