Skip to content

Commit 20d68bc

Browse files
committed
Merge pull request #1590 from apple/revert-1569-noescape-encode
Revert "[stdlib] Add @NoEscape to output parameter of UnicodeCodecType.encode" Filed https://bugs.swift.org/browse/SR-901 to look into the compiler crash.
2 parents 3fb06d7 + 2a5a890 commit 20d68bc

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

stdlib/public/core/String.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ extension String {
286286
// with unpaired surrogates
287287
func _encode<
288288
Encoding: UnicodeCodecType
289-
>(encoding: Encoding.Type, @noescape output: (Encoding.CodeUnit) -> Void)
289+
>(encoding: Encoding.Type, output: (Encoding.CodeUnit) -> Void)
290290
{
291291
return _core.encode(encoding, output: output)
292292
}

stdlib/public/core/StringCore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ public struct _StringCore {
326326
/// Write the string, in the given encoding, to output.
327327
func encode<
328328
Encoding: UnicodeCodecType
329-
>(encoding: Encoding.Type, @noescape output: (Encoding.CodeUnit) -> Void)
329+
>(encoding: Encoding.Type, output: (Encoding.CodeUnit) -> Void)
330330
{
331331
if _fastPath(_baseAddress != nil) {
332332
if _fastPath(elementWidth == 1) {

stdlib/public/core/Unicode.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public protocol UnicodeCodecType {
6666

6767
/// Encode a `UnicodeScalar` as a series of `CodeUnit`s by
6868
/// calling `output` on each `CodeUnit`.
69-
static func encode(input: UnicodeScalar, @noescape output: (CodeUnit) -> Void)
69+
static func encode(input: UnicodeScalar, output: (CodeUnit) -> Void)
7070
}
7171

7272
/// A codec for [UTF-8](http://www.unicode.org/glossary/#UTF_8).
@@ -389,7 +389,7 @@ public struct UTF8 : UnicodeCodecType {
389389
/// calling `output` on each `CodeUnit`.
390390
public static func encode(
391391
input: UnicodeScalar,
392-
@noescape output put: (CodeUnit) -> Void
392+
output put: (CodeUnit) -> Void
393393
) {
394394
var c = UInt32(input)
395395
var buf3 = UInt8(c & 0xFF)
@@ -558,7 +558,7 @@ public struct UTF16 : UnicodeCodecType {
558558
/// calling `output` on each `CodeUnit`.
559559
public static func encode(
560560
input: UnicodeScalar,
561-
@noescape output put: (CodeUnit) -> Void
561+
output put: (CodeUnit) -> Void
562562
) {
563563
let scalarValue: UInt32 = UInt32(input)
564564

@@ -616,7 +616,7 @@ public struct UTF32 : UnicodeCodecType {
616616
/// calling `output` on each `CodeUnit`.
617617
public static func encode(
618618
input: UnicodeScalar,
619-
@noescape output put: (CodeUnit) -> Void
619+
output put: (CodeUnit) -> Void
620620
) {
621621
put(UInt32(input))
622622
}
@@ -634,7 +634,7 @@ public func transcode<
634634
OutputEncoding : UnicodeCodecType
635635
where InputEncoding.CodeUnit == Input.Element>(
636636
inputEncoding: InputEncoding.Type, _ outputEncoding: OutputEncoding.Type,
637-
_ input: Input, @noescape _ output: (OutputEncoding.CodeUnit) -> Void,
637+
_ input: Input, _ output: (OutputEncoding.CodeUnit) -> Void,
638638
stopOnError: Bool
639639
) -> Bool {
640640
var input = input

0 commit comments

Comments
 (0)