Skip to content

Commit 37acd57

Browse files
committed
Infer @_lifetime for mutating methods without experimental feature
Infer @_lifetime(self: copy self) for mutating methods without requiring the experimental Lifetimes feature to be disabled. Treatment of mutating 'self' is now consistent with other 'inout' parameters. Example: extension MutableSpan { mutating func mutatingMethod() {...} }
1 parent ada46a0 commit 37acd57

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/AST/LifetimeDependence.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ class LifetimeDependenceChecker {
481481
// returning, 'depBuilder' contains any inferred dependencies. This does
482482
// not issue any diagnostics because using unsupported lifetime features
483483
// may generate a different diagnostic when the feature flag is disabled.
484+
inferMutatingSelf();
484485
inferInoutParams();
485486

486487
diagnoseMissingResultDependencies(

0 commit comments

Comments
 (0)