]> git.lizzy.rs Git - rust.git/commit
Reduce code bloat in closure
authorBjörn Steinbrink <bsteinbr@gmail.com>
Sun, 22 Mar 2015 18:18:07 +0000 (19:18 +0100)
committerBjörn Steinbrink <bsteinbr@gmail.com>
Sun, 22 Mar 2015 18:18:07 +0000 (19:18 +0100)
commitcfe7a8db06f8e42c08ac026754d384cca595ed3e
treeb8877700eb82757b3814a1d248dc65c494842827
parentecf8c64e1b1b60f228f0c472c0b0dab4a5b5aa61
Reduce code bloat in closure

For the rust-call ABI, the last function argument is a tuple that gets
untupled for the actual call. For bare functions using this ABI, the
code has access to the tuple, so we need to tuple the arguments again.
But closures can't actually access the tuple. Their arguments map to the
elements in the tuple. So what we currently do is to tuple the arguments
and then immediately untuple them again, which is pretty useless and we
can just omit it.
src/librustc_trans/trans/base.rs