mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +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")
|
log(" has dependent function result")
|
||||||
return .continueWalk
|
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
|
return .abortWalk
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user