Commit Graph

7 Commits

Author SHA1 Message Date
Niko Matsakis
5851d3242c Move checking for moves and initialization of local variables and patterns into
borrow checker and generalize what moves are allowed. Fixes a nasty
bug or two in the pattern move checking code. Unifies dataflow code
used for initialization and other things. First step towards
once fns. Everybody wins.

Fixes #4384. Fixes #4715. cc once fns (#2202), optimizing local moves (#5016).
2013-05-28 20:22:14 -04:00
Patrick Walton
5d3559e645 librustc: Make self and static into keywords 2013-05-12 16:35:18 -07:00
Daniel Micay
86efd97a10 add gitattributes and fix whitespace issues 2013-05-03 20:01:42 -04:00
Patrick Walton
107bf96ff0 librustc: Mark all type implementations public. rs=impl-publicity 2013-02-28 11:32:24 -08:00
Niko Matsakis
0682ad0eb9 Finalize moves-based-on-type implementation.
Changes:

- Refactor move mode computation
- Removes move mode arguments, unary move, capture clauses
  (though they still parse for backwards compatibility)
- Simplify how moves are handled in trans
- Fix a number of illegal copies that cropped up
- Workaround for bug involving def-ids in params
  (see details below)

Future work (I'll open bugs for these...):

- Improve error messages for moves that are due
  to bindings
- Add support for moving owned content like a.b.c
  to borrow check, test in trans (but I think it'll
  "just work")
- Proper fix for def-ids in params

Def ids in params:

Move captures into a map instead of recomputing.

This is a workaround for a larger bug having to do with the def-ids associated
with ty_params, which are not always properly preserved when inlining.  I am
not sure of my preferred fix for the larger bug yet.  This current fix removes
the only code in trans that I know of which relies on ty_param def-ids, but
feels fragile.
2013-01-31 12:09:00 -08:00
John Clements
3bf8b8af98 s/moved variable/moved value/ 2013-01-14 17:38:22 -08:00
Patrick Walton
cd120736cb librustc: Allow moves out of self. r=nmatsakis 2012-12-13 15:49:07 -08:00