Commit Graph

6 Commits

Author SHA1 Message Date
Joe Groff
ecceb02e2a Implement consume x operator with the accepted SE-0366 syntax.
Implement it as a contextual operator that only parses as an operator when
followed by an identifier.
2023-03-01 17:37:54 -08:00
Michael Gottesman
f3081d0e9a [move-keyword] Put the move keyword behind the experimental move only flag for now.
Originally move when it was in the stdlib as _move was behind a keyword but we
moved it in front to allow for some testing. Now that we are going with a
keyword (which we can't leave in/deprecate) move it behind the move only
experimental flag until this gets through evolution.
2022-08-10 12:45:17 -07:00
Michael Gottesman
6493886e1d [move-keyword] Wire up support for the move keyword in lvalue/rvalue emission.
I also updated the move function tests to show that this is working. As a nice
bonus, I was able to enable all of the tests also in a non-optimized stdlib.
2022-08-08 12:50:42 -07:00
Arnold Schwaighofer
3e2c4ac24c Require optimized stdlib for stdlib/move_function test
rdar://86543481
2021-12-17 08:09:06 -08:00
Michael Gottesman
5aa34f43f8 [move-function] Add tests around var uniqueness properties of move. 2021-12-13 10:39:07 -08:00
Michael Gottesman
396f510d06 [move-function] Add support for properly checking let x: Int without an initial value.
We process these as loadable vars. This is really useful since it ensures that
uniqueness is preserved in this case:

```
  let x: K2
  do {
      x = self.k2
  }
  switch _move(x)[userHandle] {
  case .foo:
      assert(_isUnique(&self.k2))
  }
```

I added a test that proves this.
2021-12-11 00:18:09 -08:00