Commit Graph

2617 Commits

Author SHA1 Message Date
practicalswift
3918d9d251 [gardening] Replace likely word processor artefacts with ASCII equivalents (— → --, … → ...) 2017-01-08 15:23:06 +01:00
Ben Cohen
578a52627a Merge branch 'master' into se-147 2017-01-07 13:19:15 -08:00
practicalswift
8c2b87bce0 [gardening] Add correct copyright notices 2017-01-07 20:32:18 +01:00
practicalswift
292282e035 Merge pull request #6620 from practicalswift/gardening-20160106b
[gardening] Fix typos
2017-01-06 22:03:27 +01:00
Nate Cook
6368857344 Merge pull request #6382 from natecook1000/nc-sort-median
[stdlib] Modify sort to pivot on median of 3
2017-01-06 14:27:53 -06:00
practicalswift
30a88d38e6 [gardening] Fix recently introduced typos 2017-01-06 21:16:02 +01:00
Joe Groff
720f496b2e Merge pull request #6605 from jckarter/unsafe-bitcast-warnings
Sema: Warn about some common classes of `unsafeBitCast` misuse.
2017-01-06 09:13:56 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Joe Groff
d0787fb6b5 Sema: Warn about some common classes of unsafeBitCast misuse.
- Most immediately, we now have `withoutActuallyEscaping` as a supported way to temporarily reference a nonescaping closure as if it were escapable, and we plan to break the ABI for escaping and nonescaping closures so that the old `unsafeBitCast` workaround no longer works.
- `unsafeBitCast` is also commonly used to kludge pointers into different types, but we have more semantically meaningful APIs for type punning now. Guide users towards those APIs.
- Suggest more specific and type-safe operations, like `bitPattern:` initializers or `unsafeDowncast`, for the situations where `unsafeBitCast` is being used to avoid dynamic type checks or reinterpret numerical bits.
2017-01-05 21:19:02 -08:00
Nate Cook
b582683ecb [stdlib] Use unsigned arithmetic in partition 2017-01-05 21:32:32 -06:00
Nate Cook
5d42113375 [stdlib] Expand comments for _sort3 2017-01-05 21:32:28 -06:00
Ben Cohen
ca6353d60e Update raw version to return a typed buffer 2017-01-05 11:59:50 -08:00
Ben Cohen
d12beac355 Add UnsafeRawBufferPointer.initialize(as:from:) 2017-01-05 11:59:49 -08:00
Ben Cohen
465f243943 Move += operator for append(contentsOf:) up to RangeReplaceableCollection 2017-01-05 11:59:49 -08:00
Ben Cohen
fefc2e40df Migrate _copyContents to be called from UnsafeMutableBufferPointer with checks for overrun. 2017-01-05 11:59:49 -08:00
Nate Cook
c67ebf836a Merge pull request #6502 from xwu/init-with-literals
Add doc comments for initializers for literals [NFC]
2017-01-04 23:56:26 -06:00
Ben Cohen
8ca0df6074 Merge pull request #6542 from airspeedswift/who-fixes-the-fixmes
[stdlib] Tag a handful of additional issues with FIXME(ABI)
2017-01-04 18:43:04 -08:00
Ben Cohen
6bb212cb26 Merge pull request #6538 from airspeedswift/int-string-radix-default
[stdlib] Combine String.init(Integer) with and without radix
2017-01-04 18:42:17 -08:00
Xiaodi Wu
a698ca906b Address reviewer comments 2017-01-04 15:16:50 -06:00
swift-ci
f801430025 Merge pull request #6517 from sigito/patch-2 2017-01-03 19:51:16 -08:00
JP Simard
65688bdc39 [gardening] replace unused closure parameters with '_' in stdlib source (#6522)
* replace unused closure parameters with '_' in stdlib source

* fold some _ closure arguments into line above

* fold more _ closure arguments into line above
2017-01-03 20:10:41 -07:00
Joe Groff
796df2dc44 Merge pull request #6429 from jckarter/type-of-by-overload-resolution
`withoutActuallyEscaping`
2017-01-03 18:47:29 -08:00
Ben Cohen
9a4349ce89 Combine String.init with and without radix 2017-01-03 18:39:59 -08:00
Ben Cohen
28114baeb9 Flag various FIXMEs as ABI-impacting 2017-01-03 18:36:20 -08:00
Robert Widmann
e1822bccfa Merge pull request #6516 from sigito/patch-1
Removed repetitive docstring
2017-01-03 17:35:37 -07:00
JP Simard
7301b79342 remove superfluous parentheses in control statements in stdlib source
since this appears to be the convention followed elsewhere in the code base.
2016-12-31 18:40:15 -08:00
Yurii Samsoniuk
2b62ed250a Updated index(_:offsetBy:limitedBy:) code example 2016-12-31 15:48:52 +01:00
Yurii Samsoniuk
faa7c749df Removed repetitive docstring 2016-12-31 15:19:44 +01:00
Xiaodi Wu
539dc2a6d0 Add doc comments for initializers for literals 2016-12-28 15:13:28 -05:00
Joe Groff
0c9297862f Sema: Handle type-checking for withoutActuallyEscaping.
withoutActuallyEscaping has a signature like `<T..., U, V, W> (@nonescaping (T...) throws<U> -> V, (@escaping (T...) throws<U> -> V) -> W) -> W, but our type system for functions unfortunately isn't quite that expressive yet, so we need to special-case it. Set up the necessary type system when resolving an overload set to reference withoutActuallyEscaping, and if a type check succeeds, build a MakeTemporarilyEscapableExpr to represent it in the type-checked AST.
2016-12-22 17:51:26 -08:00
Joe Groff
1889fde228 Resolve type(of:) by overload resolution rather than parse hackery.
`type(of:)` has behavior whose type isn't directly representable in Swift's type system, since it produces both concrete and existential metatypes. In Swift 3 we put in a parser hack to turn `type(of: <expr>)` into a DynamicTypeExpr, but this effectively made `type(of:)` a reserved name. It's a bit more principled to put `Swift.type(of:)` on the same level as other declarations, even with its special-case type system behavior, and we can do this by special-casing the type system we produce during overload resolution if `Swift.type(of:)` shows up in an overload set. This also lays groundwork for handling other declarations we want to ostensibly behave like normal declarations but with otherwise inexpressible types, viz. `withoutActuallyEscaping` from SE-0110.
2016-12-22 16:28:31 -08:00
Nate Cook
0a0c77ed3f Merge pull request #6275 from natecook1000/nc-revise-pointers
[stdlib] Revise unsafe pointers documentation
2016-12-22 15:19:51 -06:00
Nate Cook
4edccfef63 [stdlib] Change wording in UnsafeBufferPointer discussion 2016-12-22 12:54:26 -06:00
swift-ci
6805ecccae Merge pull request #6311 from natecook1000/nc-fixes-06 2016-12-21 21:28:48 -08:00
practicalswift
ce7a10474f [gardening] Fix accidental double and triple spaces. 2016-12-21 22:13:56 +01:00
Nate Cook
606bf83af3 [stdlib] Modify intro sort to pivot on median of 3
This modifies the _partition function used during sorting to select
the median of the first, middle, and last elements in the range to
be partitioned. Before partitioning begins, those three elements are
sorted, after which the middle element is selected as the pivot. This
change improves performance for sorted or nearly-sorted data.
2016-12-21 13:19:42 -06:00
Nate Cook
77fc4948cc [stdlib] Add note about pointer alignment for subtraction 2016-12-20 12:39:01 -06:00
Ben Cohen
11e8a1feda Merge pull request #6388 from airspeedswift/_assertFailure-labels
[stdlib] Adjust _assertionFailed signature for naming guidelines
2016-12-20 08:49:59 -08:00
Nate Cook
4169635a20 [stdlib] Consistency fixes in Array documentation
- Removed "see other" note from type discussion
- Modified index(_:offsetBy...) to match other collections
- Word choice in reserveCapacity(_:)
2016-12-19 14:16:36 -06:00
Nate Cook
82811c57f0 [stdlib] Improvements to Collection doc comments 2016-12-19 13:05:19 -06:00
Ben Cohen
f089e16c61 kill another FIXME I missed 2016-12-19 09:53:40 -08:00
Ben Cohen
14bbb92466 Adjust _assertionFailed signature for naming guidelines 2016-12-19 08:51:42 -08:00
Paul Hudson
94ef84b649 Minor style fix: added space before brace. 2016-12-18 19:15:13 +00:00
Nate Cook
f2bc719eff [stdlib] Address feedback from @stephentyrone 2016-12-15 13:55:38 -06:00
Nate Cook
a14daa0c44 [stdlib] Address feedback from @gottesmm 2016-12-15 13:52:33 -06:00
Nate Cook
e070568078 [stdlib] Add documentation for pointer operators 2016-12-15 13:51:32 -06:00
Nate Cook
3bc4909de8 [stdlib] Various revisions and fixes for documentation
- Fix wording for RandomAccessCollection
- Add note about array growth to reserveCapacity(_:)
- Reformat lazy flatMap discussions
- Improve Collection symbol consistency
2016-12-15 11:47:19 -06:00
Nate Cook
7494e2045e [stdlib] Revise unsafe pointers documentation
This revises and expands upon documentation for the standard library's
unsafe pointer types. This includes typed and raw pointers and buffers,
the MemoryLayout type, and some other top-level functions.
2016-12-14 14:58:24 -06:00
Robert Widmann
be9f205115 Merge pull request #6246 from CodaFi/the-farmer-refuted
[Stdlib][ABI] Resolve ABI FIXME #25
2016-12-14 12:20:45 -05:00
Robert Widmann
fe00dc74ea Get rid of _stdlib_didEnterMain
Process arguments are now fetched per-platform
2016-12-12 23:47:48 -05:00