Commit Graph

6 Commits

Author SHA1 Message Date
Guillaume Lessard
1d776a6b06 [stdlib] in-place initializer for InlineArray 2025-07-14 23:04:46 -07:00
Erik Eckstein
ddbc3a2fad SILGen: insert an end_lifetime in the throw-branch of a Builtin.emplace
When the called closure throws an error, it needs to clean up the buffer.
This means that the buffer is uninitialized at this point.

We need an `end_lifetime` so that the move-only checker doesn't insert a wrong `destroy_addr` because it thinks that the buffer is initialized.

Fixes a mis-compile.

rdar://151461109
2025-05-16 21:54:39 +02:00
Alejandro Alonso
bc6c88bfb1 Use the opaque element type for address in InlineArray literal 2025-03-24 10:35:14 -07:00
Ben Rimmington
71b975a8c6 [stdlib] Test empty InlineArray literals (#80121) 2025-03-19 15:06:09 -07:00
Ben Rimmington
bbe26880a5 [stdlib] Update InlineArray (2) (#79866)
* Amend doc comments.
* Add `guard` for empty array.
* Add tests for initialization errors.
* Use `Self.` to call static method.
* Use `_checkIndex` in `swapAt` method.
* Wrap overlong lines.
2025-03-18 05:59:15 +00:00
Ben Rimmington
ed5b3ca252 [stdlib] Add basic unit tests for InlineArray
FIXME: Empty array literals aren't supported.
2025-03-06 19:25:50 +00:00