Commit Graph

11 Commits

Author SHA1 Message Date
Kavon Farvardin
5230b19ef6 Test: replace '@_moveOnly' with '~Copyable' 2024-07-23 11:05:33 -07:00
Kavon Farvardin
3a533b6338 [SILGen] handle TypeExpr in BorrowedBaseVisitor
A TypeExpr and other kinds of non-lvalue bases that the borrowed-base
visitor doesn't care about can be handled by calling back into the
original SILGenLValue instance.

resolves rdar://117082469
2023-11-16 00:18:16 -08:00
Michael Gottesman
c0ce58c9a3 [move-only] Make sure to run the moveonly interpreter test also at -Onone so we can make sure it works even without opts. 2023-05-28 19:42:55 -07:00
Kavon Farvardin
37cc8cb174 add optimizations-on variants directly in noncopyable tests 2023-05-22 17:17:52 -07:00
Michael Gottesman
a0a3aecd4d [move-only] Add some execution tests that use generics. 2023-05-02 16:30:33 -07:00
Joe Groff
52e97d6544 Diagnose attempts to use tuples with noncopyable elements.
These aren't fully supported yet. rdar://108024586
2023-04-14 16:49:30 -07:00
Michael Gottesman
19f1dedf1f [move-only] When emitting an initializer for an empty struct, store an instance to make sure it is initialized.
I ran into this while fixing the parent commit when attempting to add the
interpreter test in this commit into the aforementioned parent commit.

rdar://107974302
2023-04-12 20:56:31 -07:00
Michael Gottesman
43d8ab24f4 [move-only] Add a new type of mark_must_check initable_but_not_consumable.
This is used to teach the checker that the thing being checked is supposed to be
uninitialized at the mark_must_check point so that we don't put a destroy_addr
there.

The way this is implemented is that we always initially add
assignable_but_not_consumable but in DI once we discover that the assign we are
guarding is an init, we convert the assignable to its initable variant.

rdar://106525988
2023-03-31 17:32:58 -07:00
Michael Gottesman
3de646e7c4 [move-only] Change global_addr assignable_but_not_consumable accesses such that they are initialized at end of lifetime.
I also added an interpreter test that validates that ref_element_addr works as
expected (I fixed that in an earlier commit, but did not add an interpreter
test).

rdar://106724277
2023-03-16 12:28:59 -07:00
Kavon Farvardin
2c7d9a5047 update tests given move-only types are enabled
the main things still left behind the experimental flag(s) are
- move-only classes (guarded by MoveOnlyClasses feature)
- noimplicitcopy
- the _borrow operator
2023-03-14 18:35:13 -07:00
Michael Gottesman
f9f111841e [move-only] When emitting a deinit for a move only struct with only trivial fields, use an end_lifetime instead of a destructure_struct.
rdar://104875010
2023-02-22 13:36:50 -08:00