Enable blessing of mir opt tests - #69916
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
Is there an example of how a "function allocation" would print? I couldn't find one. |
|
📌 Commit d7053261c6b1a5531e4e5a1423cba832e891b98a has been approved by |
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
|
@bors r- rustfmt |
|
☔ The latest upstream changes (presumably #70404) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@bors r=eddyb |
|
📌 Commit 178d8a4d426e265e14daf463e8b7f2652d3231b7 has been approved by |
|
@bors r=eddyb somehow my local rustfmt isn't working reliably anymore :( |
|
📌 Commit c9a5a03 has been approved by |
|
☀️ Test successful - checks-azure |
| for line in result.lines { | ||
| match line { | ||
| DiffLine::Expected(e) => { | ||
| println!("-\t{}", e); |
There was a problem hiding this comment.
Okay this is weird, but apparently println! in compiletest is not equivalent to writing to std::io::stdout(), what's happening now is that the diff is printed while the tests run, and then the output after the tests run looks like this:
diff of stderr:
The actual stderr differed from the expected stderr.
There was a problem hiding this comment.
Looking at the implementation it seems like there should be no difference unless something is calling set_print -- I think libtest does this, though, so maybe that's causing problems here.
There was a problem hiding this comment.
Ahh, compiletest is getting that behavior from libtest, that's what I was missing, thanks!
Yeah so worst case we can buffer into a String and println! that instead of using std::io::stdout.
There was a problem hiding this comment.
Turns out the changes here are unnecessary, there's only write_diff caller, and I've just tested a fix, will open a PR shortly.
EDIT: opened #70662.
cc @rust-lang/wg-mir-opt
cc @RalfJung
Long overdue, but now you can finally just add a
// EMIT_MIR rustc.function_name.MirPassName.before.mir(or
after.mirsince most of the time you want to know the MIR after a pass). A--blessinvocation will automatically create the files for you.I suggest we do this for all mir opt tests that have all of the MIR in their source anyway
If you use
rustc.function.MirPass.diffyou only get the diff that the MIR pass causes on the MIR.Fixes #67865