@@ -49,7 +49,7 @@ internal func _overrideLifetime<
4949/// the `source` argument.
5050@_unsafeNonescapableResult
5151@_transparent
52- @lifetime ( borrow source)
52+ @lifetime ( & source)
5353internal func _overrideLifetime<
5454 T: ~ Copyable & ~ Escapable, U: ~ Copyable & ~ Escapable
5555> (
@@ -110,7 +110,7 @@ struct MutableSpan<T>: ~Escapable, ~Copyable {
110110 let base : UnsafeMutablePointer < T >
111111 let count : Int
112112
113- @lifetime ( borrow base)
113+ @lifetime ( & base)
114114 init ( base: UnsafeMutablePointer < T > , count: Int ) {
115115 self . base = base
116116 self . count = count
@@ -128,7 +128,7 @@ extension Array {
128128}
129129
130130extension Array {
131- @lifetime ( borrow self)
131+ @lifetime ( & self )
132132 mutating func mutableSpan( ) -> MutableSpan < Element > {
133133 /* not the real implementation */
134134 let p = self . withUnsafeMutableBufferPointer { $0. baseAddress! }
@@ -263,7 +263,7 @@ struct MutableView: ~Escapable, ~Copyable {
263263 self . owner = copy owner // OK
264264 }
265265
266- @lifetime ( borrow mutableOwner)
266+ @lifetime ( & mutableOwner)
267267 init ( mutableOwner: inout AnyObject ) {
268268 // Initialization of a ~Escapable value is unenforced. So we can initialize
269269 // the `owner` property without locally borrowing `mutableOwner`.
@@ -432,13 +432,13 @@ func testGlobal(local: InnerTrivial) -> Span<Int> {
432432// Scoped dependence on mutable values
433433// =============================================================================
434434
435- @lifetime ( borrow a)
435+ @lifetime ( & a)
436436func testInoutBorrow( a: inout [ Int ] ) -> Span < Int > {
437437 a. span ( ) // expected-error {{lifetime-dependent value escapes its scope}}
438438 // expected-note @-1{{it depends on this scoped access to variable 'a'}}
439439} // expected-note {{this use causes the lifetime-dependent value to escape}}
440440
441- @lifetime ( borrow a)
441+ @lifetime ( & a)
442442func testInoutMutableBorrow( a: inout [ Int ] ) -> MutableSpan < Int > {
443443 a. mutableSpan ( )
444444}
@@ -460,7 +460,7 @@ extension Container {
460460 View ( owner: self . owner) // OK
461461 }
462462
463- @lifetime ( borrow self)
463+ @lifetime ( & self )
464464 mutating func mutableView( ) -> MutableView {
465465 // Reading 'self.owner' creates a local borrow scope. This new MutableView
466466 // depends on a the local borrow scope for 'self.owner', so it cannot be
@@ -469,15 +469,15 @@ extension Container {
469469 // expected-note @-1{{it depends on this scoped access to variable 'self'}}
470470 } // expected-note {{this use causes the lifetime-dependent value to escape}}
471471
472- @lifetime ( borrow self)
472+ @lifetime ( & self )
473473 mutating func mutableViewModifiesOwner( ) -> MutableView {
474474 // Passing '&self.owner' inout creates a nested exclusive access that must extend to all uses of the new
475475 // MutableView. This is allowed because the nested access is logically extended to the end of the function (without
476476 // violating exclusivity).
477477 MutableView ( mutableOwner: & self . owner)
478478 }
479479
480- @lifetime ( borrow self)
480+ @lifetime ( & self )
481481 mutating func mutableSpan( ) -> MutableSpan < T > {
482482 // Reading 'self.pointer' creates a local borrow scope. The local borrow
483483 // scope is ignored because 'pointer' is a trivial value. Instead, the new
0 commit comments