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
For closure declarations, lifetime dependencies can be inferred on the combined list of captures and closure parameters
1071
-
following the same rule as free standing functions. We can infer a lifetime dependence if the closure's return value is
1072
-
nonescapable, and exactly one closure capture or closure parameter satisfies any of the following:
1074
+
following inference rules similar to those for freestanding functions:
1075
+
1076
+
1. For closures where the return value is nonescapable, we infer a copied lifetime dependency on all captures and parameters of the same nonescapable type.
1073
1077
1074
-
- is nonescapable, or
1075
-
- is non-BitwiseCopyable and has an explicit `borrowing`, or `inout` convention
1078
+
2. For closures that have a nonescapable return value and a single captured value or parameter, we infer dependence on that capture or parameter. If the capture or parameter is nonescapable, then we infer a copying dependency; otherwise, we infer a scoped dependency.
1076
1079
1077
1080
A dependence can be inferred on a closure capture as follows:
0 commit comments