Skip to content

Commit 1f6a744

Browse files
committed
[lifetime] disable trivial dependence enforcement in .swiftinterface
Briefly, some versions of Span in the standard library violated trivial lifetimes; versions of the compiler built at that time simply ignored dependencies on trivial values. For now, disable trivial dependencies to allow newer compilers to build against those older standard libraries. This check is only relevant for ~6 mo (until July 2025).
1 parent 7a11d5a commit 1f6a744

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceDiagnostics.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,11 @@ let lifetimeDependenceDiagnosticsPass = FunctionPass(
101101
private func analyze(dependence: LifetimeDependence, _ context: FunctionPassContext) -> Bool {
102102
log("Dependence scope:\n\(dependence)")
103103

104-
// Early versions of Span in the standard library violate trivial lifetimes. Contemporary versions of the compiler
105-
// simply ignored dependencies on trivial values.
106-
if !context.options.hasFeature(.LifetimeDependenceDiagnoseTrivial) {
107-
if dependence.parentValue.type.objectType.isTrivial(in: dependence.function) {
104+
// Briefly, some versions of Span in the standard library violated trivial lifetimes; versions of the compiler built
105+
// at that time simply ignored dependencies on trivial values. For now, disable trivial dependencies to allow newer
106+
// compilers to build against those older standard libraries. This check is only relevant for ~6 mo (until July 2025).
107+
if dependence.parentValue.type.objectType.isTrivial(in: dependence.function) {
108+
if let sourceFileKind = dependence.function.sourceFileKind, sourceFileKind == .interface {
108109
return true
109110
}
110111
}

0 commit comments

Comments
 (0)