mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Bypass lifetime diagnostics in interfaces for copied arguments.
Briefly (April 2025), RawSpan._extracting, Span._extracting, and UTF8Span.span returned a borrowed value that depended on a copied argument. Continue to support those interfaces. The implementations were correct but needed an explicit _overrideLifetime.
This commit is contained in:
@@ -219,6 +219,12 @@ private struct DiagnoseDependence {
|
||||
log(" has dependent function result")
|
||||
return .continueWalk
|
||||
}
|
||||
// Briefly (April 2025), RawSpan._extracting, Span._extracting, and UTF8Span.span returned a borrowed value that
|
||||
// depended on a copied argument. Continue to support those interfaces. The implementations were correct but
|
||||
// needed an explicit _overrideLifetime.
|
||||
if let sourceFileKind = dependence.function.sourceFileKind, sourceFileKind == .interface {
|
||||
return .continueWalk
|
||||
}
|
||||
}
|
||||
return .abortWalk
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user