@@ -124,14 +124,14 @@ func test() {
124
124
125
125
The ` consume x ` operator syntax deliberately mirrors the
126
126
proposed [ ownership modifier] ( https://forums.swift.org/t/borrow-and-take-parameter-ownership-modifiers/59581 )
127
- parameter syntax, ` (x: consume T) ` , because the caller-side behavior of ` consume `
128
- operator is analogous to a callee’s behavior receiving a ` consume ` parameter.
127
+ parameter syntax, ` (x: consuming T) ` , because the caller-side behavior of ` consume `
128
+ operator is analogous to a callee’s behavior receiving a ` consuming ` parameter.
129
129
` doStuffUniquely(with:) ` can use the ` consume ` operator, combined with
130
- the ` consume ` parameter modifier, to preserve the uniqueness of the parameter
130
+ the ` consuming ` parameter modifier, to preserve the uniqueness of the parameter
131
131
as it moves it into its own local variable for mutation:
132
132
133
133
``` swift
134
- func doStuffUniquely (with value : consume [Int ]) {
134
+ func doStuffUniquely (with value : consuming [Int ]) {
135
135
// If we received the last remaining reference to `value`, we'd like
136
136
// to be able to efficiently update it without incurring more copies.
137
137
var newValue = consume value
@@ -173,7 +173,7 @@ of `doStuffUniquely` after being consumed to initialize `newValue`, they will
173
173
get an error:
174
174
175
175
``` swift
176
- func doStuffUniquely (with value : consume [Int ]) {
176
+ func doStuffUniquely (with value : consuming [Int ]) {
177
177
// If we received the last remaining reference to `value`, we'd like
178
178
// to be able to efficiently update it without incurring more copies.
179
179
var newValue = consume value
0 commit comments