]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #22385 - dotdash:slice_by_val_copy, r=nikomatsakis
authorManish Goregaokar <manishsmail@gmail.com>
Tue, 17 Feb 2015 10:11:33 +0000 (15:41 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Tue, 17 Feb 2015 12:03:17 +0000 (17:33 +0530)
commit34ab88e30b8b61e084af4fd3accbeb1e90ef8a50
tree4738d9f2e8bba52c871c2b7228adcace7053321c
parent4a7eed1e01c5961199e8a125ef80d133c9c0f3d4
parent4808561c45df77b6a7f8721f22b2f1e324cbeb3d
Rollup merge of #22385 - dotdash:slice_by_val_copy, r=nikomatsakis

When matching against strings/slices, we call the comparison function
for strings, which takes two string slices by value. The slices are
passed in memory, and currently we just pass in a pointer to the
original slice. That can cause misoptimizations because we emit a call
to llvm.lifetime.end for all by-value arguments at the end of a
function, which in this case marks the original slice as dead.

So we need to properly create copies of the slices to pass them to the
comparison function.

Fixes #22008
src/librustc_trans/trans/_match.rs