Skip to content

Commit ecf2e36

Browse files
committed
LifetimeDependenceDiagnostics: FIXME for @_unsafeNonEscapableResult
Reminder to add a builtin to reliably enforce this unsafe attribute.
1 parent 1cdf9d5 commit ecf2e36

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceDiagnostics.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ private struct DiagnoseDependence {
131131
if function.hasUnsafeNonEscapableResult {
132132
return .continueWalk
133133
}
134+
// FIXME: remove this condition once we have a Builtin.dependence,
135+
// which developers should use to model the unsafe
136+
// dependence. Builtin.lifetime_dependence will be lowered to
137+
// mark_dependence [unresolved], which will be checked
138+
// independently. Instead, of this function result check, allow
139+
// isUnsafeApplyResult to be used be mark_dependence [unresolved]
140+
// without checking its dependents.
141+
//
134142
// Allow returning an apply result (@_unsafeNonescapableResult) if
135143
// the calling function has a dependence. This implicitly makes
136144
// the unsafe nonescapable result dependent on the calling

0 commit comments

Comments
 (0)