|
6 | 6 | // Check that functions that require lifetime dependence are prohibited without the flag. |
7 | 7 |
|
8 | 8 | // Don't allow empty initialization. |
9 | | -struct EmptyNonEscapable: ~Escapable {} // expected-error{{an implicit initializer with a ~Escapable result requires '-enable-experimental-feature LifetimeDependence'}} |
| 9 | +struct EmptyNonEscapable: ~Escapable {} // expected-error{{an implicit initializer cannot return a ~Escapable result}} |
10 | 10 |
|
11 | 11 | // Don't allow non-Escapable return values. |
12 | | -func neReturn(span: RawSpan) -> RawSpan { span } // expected-error{{a function with a ~Escapable result requires '-enable-experimental-feature LifetimeDependence'}} |
| 12 | +func neReturn(span: RawSpan) -> RawSpan { span } // expected-error{{a function cannot return a ~Escapable result}} |
13 | 13 |
|
14 | 14 | func neInout(span: inout RawSpan) {} // OK |
15 | 15 |
|
16 | | -func neInoutNEParam(span: inout RawSpan, _: RawSpan) {} // expected-error{{a function with a ~Escapable 'inout' parameter requires '-enable-experimental-feature LifetimeDependence'}} |
| 16 | +func neInoutNEParam(span: inout RawSpan, _: RawSpan) {} // expected-error{{a function cannot have a ~Escapable 'inout' parameter 'span'}} |
17 | 17 |
|
18 | 18 | struct S { |
19 | | - func neReturn(span: RawSpan) -> RawSpan { span } // expected-error{{a method with a ~Escapable result requires '-enable-experimental-feature LifetimeDependence'}} |
| 19 | + func neReturn(span: RawSpan) -> RawSpan { span } // expected-error{{a method cannot return a ~Escapable result}} |
20 | 20 |
|
21 | 21 | func neInout(span: inout RawSpan) {} // OK |
22 | 22 |
|
23 | | - func neInoutNEParam(span: inout RawSpan, _: RawSpan) {} // expected-error{{a method with a ~Escapable 'inout' parameter requires '-enable-experimental-feature LifetimeDependence'}} |
| 23 | + func neInoutNEParam(span: inout RawSpan, _: RawSpan) {} // expected-error{{a method cannot have a ~Escapable 'inout' parameter 'span'}} |
24 | 24 |
|
25 | 25 | mutating func mutatingNEInout(span: inout RawSpan) {} // OK |
26 | 26 |
|
27 | | - mutating func mutatingNEInoutParam(span: inout RawSpan, _: RawSpan) {} // expected-error{{a mutating method with a ~Escapable 'inout' parameter requires '-enable-experimental-feature LifetimeDependence'}} |
| 27 | + mutating func mutatingNEInoutParam(span: inout RawSpan, _: RawSpan) {} // expected-error{{a mutating method cannot have a ~Escapable 'inout' parameter 'span'}} |
28 | 28 | } |
29 | 29 |
|
30 | 30 | class C { |
31 | | - func neReturn(span: RawSpan) -> RawSpan { span } // expected-error{{a method with a ~Escapable result requires '-enable-experimental-feature LifetimeDependence'}} |
| 31 | + func neReturn(span: RawSpan) -> RawSpan { span } // expected-error{{a method cannot return a ~Escapable result}} |
32 | 32 |
|
33 | 33 | func neInout(span: inout RawSpan) {} // OK |
34 | 34 | } |
35 | 35 |
|
36 | 36 | extension MutableSpan { |
37 | 37 | func method() {} // OK |
38 | 38 |
|
39 | | - mutating func mutatingMethod() {} // expected-error{{a mutating method with ~Escapable 'self' requires '-enable-experimental-feature LifetimeDependence'}} |
| 39 | + mutating func mutatingMethod() {} // expected-error{{a mutating method cannot have a ~Escapable 'self'}} |
40 | 40 |
|
41 | | - func neReturn(span: RawSpan) -> RawSpan { span } // expected-error{{a method with a ~Escapable result requires '-enable-experimental-feature LifetimeDependence'}} |
| 41 | + func neReturn(span: RawSpan) -> RawSpan { span } // expected-error{{a method cannot return a ~Escapable result}} |
42 | 42 |
|
43 | | - func neInout(span: inout RawSpan) {} // expected-error{{a method with a ~Escapable 'inout' parameter requires '-enable-experimental-feature LifetimeDependence'}} |
| 43 | + func neInout(span: inout RawSpan) {} // expected-error{{a method cannot have a ~Escapable 'inout' parameter 'span'}} |
44 | 44 |
|
45 | | - mutating func mutatingNEInout(span: inout RawSpan) {} // expected-error{{a mutating method with ~Escapable 'self' requires '-enable-experimental-feature LifetimeDependence'}} |
46 | | - // expected-error@-1{{a mutating method with a ~Escapable 'inout' parameter requires '-enable-experimental-feature LifetimeDependence'}} |
| 45 | + mutating func mutatingNEInout(span: inout RawSpan) {} // expected-error{{a mutating method cannot have a ~Escapable 'self'}} |
| 46 | + // expected-error@-1{{a mutating method cannot have a ~Escapable 'inout' parameter 'span'}} |
47 | 47 | } |
0 commit comments