You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@_lifetime() // expected-error{{expected identifier, index or self in lifetime dependence specifier}}
27
+
@_lifetime() // expected-error{{expected 'copy', 'borrow', or '&' followed by an identifier, index or 'self' in lifetime dependence specifier}}
28
28
func testMissingDependence(_ ne:NE)->NE{ // expected-error{{cannot infer the lifetime dependence scope on a function with a ~Escapable parameter, specify '@_lifetime(borrow ne)' or '@_lifetime(copy ne)'}}
// Unable to infer an 'inout' dependency. Provide valid guidance.
589
+
//
590
+
func f_inout_no_infer(a: inout MutNE, b: NE){}
591
+
// expected-error @-1{{a function with a ~Escapable 'inout' parameter requires '@_lifetime(a: ...)'}}
592
+
// expected-note @-2{{use '@_lifetime(a: copy a) to forward the inout dependency}}
593
+
594
+
// Invalid keyword for the dependence kind.
595
+
//
596
+
@_lifetime(a: inout a) // expected-error{{expected 'copy', 'borrow', or '&' followed by an identifier, index or 'self' in lifetime dependence specifier}}
597
+
func f_inout_bad_keyword(a:inoutMutableRawSpan){}
598
+
599
+
// Don't allow a useless borrow dependency on an inout param--it is misleading.
600
+
//
601
+
@_lifetime(a:&a) // expected-error{{invalid use of inout dependence on the same inout parameter}}
602
+
// expected-note @-1{{use '@_lifetime(a: copy a) to forward the inout dependency}}
0 commit comments