]> git.lizzy.rs Git - rust.git/commit
inliner: Copy unevaluated constants only after successful inlining
authorTomasz Miąsko <tomasz.miasko@gmail.com>
Thu, 5 Nov 2020 00:00:00 +0000 (00:00 +0000)
committerTomasz Miąsko <tomasz.miasko@gmail.com>
Thu, 5 Nov 2020 00:00:00 +0000 (00:00 +0000)
commit6ca43aca1d550855e32f516cf8c89fd9e717d8f7
tree8f08febe281946e19a78767b68685caa5614f9ba
parent8c2070121905b66698ebbfb105eab30f3484e602
inliner: Copy unevaluated constants only after successful inlining

Inliner copies the unevaluated constants from the callee body to the
caller at the point where decision to inline is yet to be made. The
constants will be unnecessary if inlining were to fail.

Organize the code moving items from callee to the caller together in one
place to avoid the issue.
compiler/rustc_mir/src/transform/inline.rs