Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove uses of last-use analysis #3754

Merged
merged 18 commits into from Oct 13, 2012

Conversation

catamorphism
Copy link
Contributor

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.

@catamorphism
Copy link
Contributor Author

r? @nikomatsakis

@nikomatsakis
Copy link
Contributor

r+

@nikomatsakis
Copy link
Contributor

One thought: to avoid errors with inconsistent messages (like "Try adding a move"), you could use a const tryadding: &str = "Try adding a move". I think that'd work fine.

@catamorphism catamorphism merged commit c6780fb into rust-lang:incoming Oct 13, 2012
bors pushed a commit to rust-lang-ci/rust that referenced this pull request May 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants