Commit Graph

20 Commits

Author SHA1 Message Date
Stephen Canon
337b20e8ed Remove some redundant unsafe markings (#83192)
We were getting warnings about these; remove them to cut down on noise.
2025-07-21 11:22:13 -04:00
Doug Gregor
457eb4cc64 [Strict memory safety] Update standard library for nested safe/unsafe types
Use this to mark a few internal types @safe now that it works properly.
2025-04-19 19:54:32 -07:00
Allan Shortlidge
87db90c0da stdlib: Address StrictMemorySafety warnings in Dictionary related code. 2025-03-31 16:45:08 -07:00
Doug Gregor
22eecacc35 Adopt unsafe annotations throughout the standard library 2025-02-26 14:28:01 -08:00
Alejandro Alonso
676b8e7bae Update stdlib/public/core/DictionaryBuilder.swift
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
2024-06-04 20:46:11 +00:00
Alejandro Alonso
551acb3d4b Guard for empty singleton in dictionary builder 2024-06-04 13:30:03 -07:00
Alejandro Alonso
f9f640b141 Sendablize the standard library
oops dont add this flag

no more nonisolated
2024-03-05 15:02:09 -08:00
Alex Martini
1186fc7f13 Remove "iff" from doc comments.
This abbreviation for "if and only if" is confusing to those not coming
from a background in formal mathematics, and is frequently reported as a
type by developers reading the documentation.

This commit also changes doc comments in internal and private members,
which don't become part of the public documentation, because omitting
"iff" everywhere makes it much easier to check for any later changes
that reintroduce it.
2021-10-29 10:16:27 -07:00
Matt Zanchelli
be13b470aa Fix typos
becuase -> because
preceeds -> precedes
initalizer -> initializer
intialize -> initialize
libary -> library
notfication -> notification
reciever -> receiver
collecton -> collection
exlcusive -> exclusive
techincal -> technical
compatability -> compatibility
setps -> steps
accomodate -> accommodate
brakcet -> bracket
fraciton -> fraction
programm -> program
concequently -> consequently
ecoding -> encoding
timeIntervalforSelfEnd -> timeIntervalForSelfEnd
2020-12-21 18:44:03 -05:00
Ben Cohen
e9d4687e31 De-underscore @frozen, apply it to structs (#24185)
* De-underscore @frozen for enums

* Add @frozen for structs, deprecate @_fixed_layout for them

* Switch usage from _fixed_layout to frozen
2019-05-30 17:55:37 -07:00
Karoy Lorentey
3c74c0f1cb [stdlib] Change the signature of Dictionary’s bulk initializer (#23758)
The initializer was originally introduced without proper availability; in https://github.com/apple/swift/pull/23643, we fixed this by applying the `@_alwaysEmitIntoClient` attribute. However, this had the unfortunate side-effect that the symbol disappeared from `libswiftCore.dylib`, which somehow confuses some simulator builds.

Try to figure out what’s happening by replacing the third closure argument with an integer return value. This changes the mangled name of the bulk initializer, which should make it more obvious how/why these builds fail.

rdar://problem/49479386
2019-04-03 10:51:36 -07:00
Karoy Lorentey
7b654b372f [stdlib] Fix availability of Dictionary’s bulk-loading initializer (#23643)
Making it @_alwaysEmitIntoClient makes it available in all OS versions.
2019-03-29 12:54:56 -07:00
Karoy Lorentey
9d61bad1e5 [stdlib] Keep the first duplicate key instead of the last 2018-12-18 09:49:58 -08:00
Karoy Lorentey
f862ad3741 [stdlib] Doc updates 2018-12-18 09:49:58 -08:00
Karoy Lorentey
f0e04f73f4 [stdlib] Process elements from back to front 2018-12-18 09:49:58 -08:00
Karoy Lorentey
039891c24b [stdlib] Dictionary: Add support for non-unique keys in bulk loading init 2018-12-18 09:49:58 -08:00
Karoy Lorentey
f1f5e0f2bf [stdlib] Dictionary: Add unsafe bulk-loading initializer
Interface inspired by this Array pitch:
https://forums.swift.org/t/array-initializer-with-access-to-uninitialized-buffer/13689
2018-12-18 09:49:58 -08:00
Karoy Lorentey
84d8cedaae [stdlib] _SetBuilder, _DictionaryBuilder: Assume target has enough capacity
The compiled code included unnecessary references to resize().
2018-10-05 12:33:25 +01:00
Karoy Lorentey
c3bc84e680 [stdlib] Set, Dictionary: __consuming/__owned audit
Add __consuming and __owned to Set and Dictionary members where applicable.

Ignore compiler intrinsics for casting for now — their ARC behavior is covered by unit tests that need to be updated.
2018-09-24 13:46:40 +01:00
Karoy Lorentey
e9186000d0 [stdlib][NFC] Break Set/Dictionary implementation into smaller files
This has long been overdue; splitting the Dictionary.swift/Set.swift monoliths makes for a far less confusing editing experience.
2018-09-23 01:38:37 +01:00