-
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
[mir-inlining] Don't inline virtual calls #55046
Conversation
r? @varkor (rust_highfive has picked a reviewer for you, use r? to override) |
src/librustc_mir/transform/inline.rs
Outdated
let is_virtual = | ||
if let InstanceDef::Virtual(..) = instance.def { | ||
true | ||
} else { false }; |
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.
Nit: false
should be on its own line.
@@ -0,0 +1,41 @@ | |||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT |
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.
Copyright is no longer needed.
println!("{}", test(&())); | ||
} | ||
|
||
fn test(x: &X) -> u32 { |
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.
Prefer &dyn X
over &X
.
Was it inlining the default function implementation, or the implementation for |
It was inlining the default implementation so prior to the patch, the test would output |
bc47afd
to
6c2dace
Compare
Feedback resolved. Thanks @varkor! |
Prior to this change, the test case would output `1` instead of `2` like it should.
6c2dace
to
69eaa11
Compare
@bors r=varkor |
📌 Commit 69eaa11 has been approved by |
[mir-inlining] Don't inline virtual calls
☀️ Test successful - status-appveyor, status-travis |
Just, something strange is going on, and while the tests pass locally they fail on CI?!? See #55086. |
@RalfJung Is there anything that needs to be done related to this bug fix? I see you closed the other pull request. |
Yeah, turns out I was wrong when I thought that the ICE got fixed. :( Sorry for the noise. |
No worries :) |
No description provided.