Skip to content

Commit dda2ca6

Browse files
committed
Merge remote-tracking branch 'origin/main' into rebranch
2 parents 748c4eb + 50be389 commit dda2ca6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

include/swift/Basic/Features.def

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ LANGUAGE_FEATURE(NonescapableAccessorOnTrivial, 0, "Support UnsafeMutablePointer
273273
BASELINE_LANGUAGE_FEATURE(LayoutPrespecialization, 0, "Layout pre-specialization")
274274
BASELINE_LANGUAGE_FEATURE(IsolatedDeinit, 371, "isolated deinit")
275275
LANGUAGE_FEATURE(InlineArrayTypeSugar, 483, "Type sugar for InlineArray")
276+
LANGUAGE_FEATURE(LifetimeDependenceMutableAccessors, 0, "Support mutable accessors returning ~Escapable results")
277+
LANGUAGE_FEATURE(InoutLifetimeDependence, 0, "Support @_lifetime(&)")
276278

277279
// Swift 6
278280
UPCOMING_FEATURE(ConciseMagicFile, 274, 6)
@@ -435,10 +437,6 @@ EXPERIMENTAL_FEATURE(StructLetDestructuring, true)
435437
/// Enable returning non-escapable types from functions.
436438
EXPERIMENTAL_FEATURE(LifetimeDependence, true)
437439

438-
/// Enable inout lifetime dependence - @lifetime(&arg)
439-
EXPERIMENTAL_FEATURE(InoutLifetimeDependence, true)
440-
EXPERIMENTAL_FEATURE(LifetimeDependenceMutableAccessors, true)
441-
442440
/// Enable the `@_staticExclusiveOnly` attribute.
443441
EXPERIMENTAL_FEATURE(StaticExclusiveOnly, true)
444442

stdlib/public/Differentiation/ArrayDifferentiation.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,11 @@ extension Array where Element: Differentiable {
369369
value: [Result],
370370
pullback: (Array<Result>.TangentVector) -> Array.TangentVector
371371
) {
372+
let count = self.count
372373
var values: [Result] = []
373374
var pullbacks: [(Result.TangentVector) -> Element.TangentVector] = []
375+
values.reserveCapacity(count)
376+
pullbacks.reserveCapacity(count)
374377
for x in self {
375378
let (y, pb) = valueWithPullback(at: x, of: body)
376379
values.append(y)

0 commit comments

Comments
 (0)