]> git.lizzy.rs Git - rust.git/commit
Don't create adjustments from a type to itself
authorBjörn Steinbrink <bsteinbr@gmail.com>
Tue, 15 Sep 2015 23:26:58 +0000 (01:26 +0200)
committerBjörn Steinbrink <bsteinbr@gmail.com>
Thu, 17 Sep 2015 13:10:21 +0000 (15:10 +0200)
commit6def06c973b3aded197789c4b02d20ad378165f8
treecb4161a969cea235c888535302c30d56be561c1c
parent2d4ae52cbdca96d4dd6d5a009e4a5ef87a279df0
Don't create adjustments from a type to itself

Currently, we're generating adjustments, for example, to get from &[u8]
to &[u8], which is unneeded and kicks us out of trans_into() into
trans() which means an additional stack slot and copy in the unoptimized
code.
src/librustc_typeck/check/coercion.rs
src/test/codegen/adjustments.rs [new file with mode: 0644]