Skip to content

Diagnose @_lifetime on targets that are Escapable #83111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 23, 2025

Conversation

meg-gupta
Copy link
Contributor

No description provided.

@meg-gupta
Copy link
Contributor Author

@swift-ci smoke test

@meg-gupta meg-gupta changed the title [DNM] Diagnose @_lifetime on targets that are Escapable Diagnose @_lifetime on targets that are Escapable Jul 21, 2025
@meg-gupta meg-gupta requested a review from atrick July 21, 2025 17:48
@meg-gupta
Copy link
Contributor Author

@swift-ci test

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@meg-gupta
Copy link
Contributor Author

@swift-ci test

Lifetime dependencies can be attached to ~Escapable types only
@meg-gupta meg-gupta force-pushed the lifediag branch 2 times, most recently from d59616e to c8defec Compare July 22, 2025 13:31
@meg-gupta
Copy link
Contributor Author

@swift-ci test

Copy link
Contributor

@Xazax-hun Xazax-hun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a couple more questions/asks about tests but otherwise looks good!

@meg-gupta meg-gupta force-pushed the lifediag branch 2 times, most recently from ec84366 to d7b7fba Compare July 22, 2025 14:04
@meg-gupta
Copy link
Contributor Author

@swift-ci test

@@ -128,23 +126,6 @@ func noescapeMutOpt(_ ptr: UnsafeMutablePointer<CInt>?) -> UnsafeMutablePointer<
// CHECK-NEXT: }()
// CHECK-NEXT: }

// CHECK: @_alwaysEmitIntoClient @_lifetime(copy ptr) @_disfavoredOverload
// CHECK-NEXT: func noescapeOpt(_ ptr: Span<CInt>?) -> UnsafePointer<CInt>? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no longer any overload generated for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this no longer exists.

@meg-gupta
Copy link
Contributor Author

@swift-ci test

@meg-gupta meg-gupta enabled auto-merge July 22, 2025 17:40
@meg-gupta
Copy link
Contributor Author

@swift-ci test

@meg-gupta meg-gupta merged commit 83399f9 into swiftlang:main Jul 23, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants