Commit Graph

9 Commits

Author SHA1 Message Date
Nate Chandler
cda365ca8d [stdlib] Collection types are eagerMove.
Types that have "value semantics" should not have lexical lifetimes.
Value types are not expected to have custom deinits. Are not expected to
expose unsafe interior pointers. And cannot have weak references because
they are structs. Therefore, deinitialization barriers are irrelevant.

rdar://107076869
2023-03-30 11:04:47 -07:00
Kavon Farvardin
2be061cb06 explicitly enable MoveOnly feature for some stdlib tests
We ran into an issue on minimal stdlib build configurations, because they
pull slightly older toolchains to build and test the stdlib. Adding this flag
doesn't hurt anything and just ensures things will work with older compilers.
But it is not needed and should eventually be safe to remove.

part of resolving rdar://106849189
2023-03-24 16:03:11 -07:00
Kavon Farvardin
528d2cfca1 enable full optimizations in test
doesn't seem to be a need to skip destroy hoisting
anymore.
2023-03-14 18:35:13 -07:00
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