-
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
Extend MIR inlining to all operand variants #54416
Conversation
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.
Code changes look good to me. Can you also write a test that shows that let f = foo; f()
inlines correctly? (See src/test/mir-opt/inline-closure-borrows-arg.rs
for an example)
Of course! give me a couple minutes to do it :) |
Something like this fn foo() -> i32 {
let f = |x: i32, y: i32| x + y;
f(1, -1)
} would be a good test? Or did I misunderstood something? |
I think we want something like:
|
But then how do I check that the MIR code is in fact what we want? Should I do something like
And then check that inside |
Yeah, that looks right to me. Sorry, I don't have a compiler available at the moment so I can't give you the specific MIR instruction but we want to make sure that |
Bad news, I'm getting
Which means inlining is not happening. |
Does adding an |
Yeah it does! should I left the |
Yeah, go ahead and leave it in. The goal is to verify |
Ok, I'll finish the test and commit again. Any name ideas for this test? |
I'd either go with |
Thanks!! @bors r+ |
📌 Commit 99af55b44d9081acf27d998c3413a86188bc600b has been approved by |
⌛ Testing commit 99af55b44d9081acf27d998c3413a86188bc600b with merge 6100d69d31d30131798b14e0b99d9ecb885bd5fc... |
💔 Test failed - status-travis |
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+ |
📌 Commit 1e3c86e has been approved by |
💔 Test failed - status-appveyor |
It seems it was a connection problem inside appveyor: https://ci.appveyor.com/project/rust-lang/rust/build/1.0.9089/job/w3c09bbqp6akf7ie#L7208 |
☀️ Test successful - status-appveyor, status-travis |
This fixes #54193
r? @eddyb