]> git.lizzy.rs Git - rust.git/commit
Don't inline virtual calls (take 2)
authorWesley Wiser <wwiser@gmail.com>
Wed, 7 Nov 2018 03:31:09 +0000 (22:31 -0500)
committerWesley Wiser <wwiser@gmail.com>
Sat, 10 Nov 2018 03:11:40 +0000 (22:11 -0500)
commit3cce5c79778088a26f6099f293256d5d7834fdb3
tree6684650ae06e79c0806415acb3e15e12cf076a51
parent36a50c29f6c5c386fba6ab685818755ac55152e5
Don't inline virtual calls (take 2)

When I fixed the previous mis-optimizations, I didn't realize there were
actually two different places where we mutate `callsites` and both of
them should have the same behavior.

As a result, if a function was inlined and that function contained
virtual function calls, they were incorrectly being inlined. I also
added a test case which covers this.
src/librustc_mir/transform/inline.rs
src/test/mir-opt/inline-trait-method_2.rs [new file with mode: 0644]