@@ -40,7 +40,7 @@ struct NonEscapableSelf: ~Escapable {
40
40
@_lifetime ( copy self) // OK
41
41
mutating func mutatingMethodNoParamCopy( ) -> NonEscapableSelf { self }
42
42
43
- @_lifetime ( borrow self) // OK
43
+ @_lifetime ( & self ) // OK
44
44
mutating func mutatingMethodNoParamBorrow( ) -> NonEscapableSelf { self }
45
45
46
46
func methodOneParam( _: Int ) -> NonEscapableSelf { self } // expected-error{{a method with a ~Escapable result requires '@_lifetime(...)'}}
@@ -63,7 +63,7 @@ struct NonEscapableSelf: ~Escapable {
63
63
@_lifetime ( copy self) // OK
64
64
mutating func mutatingMethodOneParamCopy( _: Int ) -> NonEscapableSelf { self }
65
65
66
- @_lifetime ( borrow self) // OK
66
+ @_lifetime ( & self ) // OK
67
67
mutating func mutatingMethodOneParamBorrow( _: Int ) -> NonEscapableSelf { self }
68
68
}
69
69
@@ -87,7 +87,7 @@ struct EscapableTrivialSelf {
87
87
@_lifetime ( copy self) // expected-error{{cannot copy the lifetime of an Escapable type, use '@_lifetime(&self)' instead}}
88
88
mutating func mutatingMethodNoParamCopy( ) -> NEImmortal { NEImmortal ( ) }
89
89
90
- @_lifetime ( borrow self)
90
+ @_lifetime ( & self )
91
91
mutating func mutatingMethodNoParamBorrow( ) -> NEImmortal { NEImmortal ( ) }
92
92
93
93
func methodOneParam( _: Int ) -> NEImmortal { NEImmortal ( ) } // expected-error{{a method with a ~Escapable result requires '@_lifetime(...)'}}
@@ -109,7 +109,7 @@ struct EscapableTrivialSelf {
109
109
@_lifetime ( copy self) // expected-error{{cannot copy the lifetime of an Escapable type, use '@_lifetime(&self)' instead}}
110
110
mutating func mutatingMethodOneParamCopy( _: Int ) -> NEImmortal { NEImmortal ( ) }
111
111
112
- @_lifetime ( borrow self)
112
+ @_lifetime ( & self )
113
113
mutating func mutatingMethodOneParamBorrow( _: Int ) -> NEImmortal { NEImmortal ( ) }
114
114
}
115
115
@@ -341,7 +341,7 @@ struct NonescapableSelfAccessors: ~Escapable {
341
341
yield ne
342
342
}
343
343
344
- @_lifetime ( borrow self)
344
+ @_lifetime ( & self )
345
345
_modify {
346
346
yield & ne
347
347
}
@@ -401,7 +401,7 @@ struct NonescapableSelfAccessors: ~Escapable {
401
401
ne
402
402
}
403
403
404
- @_lifetime ( borrow self)
404
+ @_lifetime ( & self )
405
405
set {
406
406
ne = newValue
407
407
}
@@ -413,7 +413,7 @@ struct NonescapableSelfAccessors: ~Escapable {
413
413
yield ne
414
414
}
415
415
416
- @_lifetime ( borrow self)
416
+ @_lifetime ( & self )
417
417
_modify {
418
418
yield & ne
419
419
}
@@ -533,7 +533,7 @@ struct NonEscapableMutableSelf: ~Escapable {
533
533
@_lifetime ( self : copy self ) // OK
534
534
mutating func mutatingMethodNoParamCopy( ) { }
535
535
536
- @_lifetime ( self : borrow self ) // expected-error{{invalid use of borrow dependence on the same inout parameter}}
536
+ @_lifetime ( self : & self ) // expected-error{{invalid use of borrow dependence on the same inout parameter}}
537
537
mutating func mutatingMethodNoParamBorrow( ) { }
538
538
539
539
mutating func mutatingMethodOneParam( _: NE ) { } // expected-error{{a mutating method with a ~Escapable 'self' requires '@_lifetime(self: ...)'}}
@@ -544,6 +544,6 @@ struct NonEscapableMutableSelf: ~Escapable {
544
544
@_lifetime ( copy self) // OK
545
545
mutating func mutatingMethodOneParamCopy( _: NE ) { }
546
546
547
- @_lifetime ( borrow self)
547
+ @_lifetime ( & self )
548
548
mutating func mutatingMethodOneParamBorrow( _: NE ) { }
549
549
}
0 commit comments