Skip to content

Commit 0c6825b

Browse files
committed
Editorial comments
1 parent cfb2ded commit 0c6825b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

proposals/NNNN-non-escapable.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ struct Box<T: ~Escapable>: ~Escapable {
237237

238238
// Box gains the ability to escape whenever its
239239
// generic argument is Escapable
240-
extension Box: Escapable when T: Escapable { }
240+
extension Box: Escapable where T: Escapable { }
241241
```
242242

243243
This can be used in conjunction with other suppressible protocols.
@@ -322,9 +322,9 @@ The lifetime dependency would ensure that such an iterator could not outlive the
322322
```swift
323323
// Example: Nonescaping iterator
324324
struct NEIterator {
325-
// `borrow(container)` indicates that the constructed value
325+
// `dependsOn(container)` indicates that the constructed value
326326
// cannot outlive the `container` argument.
327-
init(over container: MyContainer) -> borrow(container) Self {
327+
init(over container: MyContainer) -> dependsOn(container) Self {
328328
... initialize an iterator suitable for `MyContainer` ...
329329
}
330330
}
@@ -385,7 +385,7 @@ struct Box<T> {
385385
}
386386

387387
// But if T requires additional checks, so does Box
388-
extension Box: Nonescapable when T: Nonescapable { }
388+
extension Box: Nonescapable where T: Nonescapable { }
389389
```
390390

391391
However, this would imply that any `Nonescapable` type was a
@@ -431,7 +431,7 @@ In particular, the use cases we’ve so far considered have all been resolvable
431431
struct NE: ~Escapable {
432432
// Proposed lifetime dependency notation;
433433
// see separate proposal for details.
434-
init(from: SomeType) -> borrow(from) Self {}
434+
init(from: SomeType) -> dependsOn(from) Self {}
435435
}
436436
```
437437

0 commit comments

Comments
 (0)