mozilla/rust — pull request #3754 by catamorphism (2012-10-13 03:51:53+00:00)
Title: Remove uses of last-use analysis

This pull request removes the reliance of kind checking and trans on last-use analysis. This means two main things:

1. Kind checking doesn't treat last-uses of vars as implicit moves, so you have to insert explicit moves to avoid warnings and errors.

2. Trans doesn't automatically translate last uses as moves. It ignores the results of last use.

There is also one separate change (I know, I know) which is to change the kind checker to make struct fields non-copyable as per #3481.

Only 9abc7f0 , c4155f5, and c6780fb need any review. The other patches are mostly just inserting implicit moves.

I had said that these patches caused a performance regression, but on further investigation, it doesn't. Either the performance hit comes from code I already checked in long ago (adding explicit moves), or -- more likely -- I was comparing between optimized and unoptimized builds :-( So I'm pretty confident that merging this pull request won't harm performance significantly.

I know we are potentially going to implement @nmatsakis's type-based move proposal, but in the meantime, this work is done and we might as well merge it to avoid the problems described in #2633.