Skip to content

Conversation

DougGregor
Copy link
Member

The interior wrapping in Result<T, U> is a little unfortunate, but is currently necessary because we end up with extra stack allocations along the error-handling path in a do..catch that aren't there when using untyped throws. We can simplify the implementation if we can eliminate the extraneous stack allocation.

Fixes rdar://134973620.

The interior wrapping in Result<T, U> is a little unfortunate, but is
currently necessary because we end up with extra stack allocations
along the error-handling path in a do..catch that aren't there when
using untyped throws. We can simplify the implementation if we can
eliminate the extraneous stack allocation.

Fixes rdar://134973620.
@DougGregor DougGregor requested a review from a team as a code owner August 26, 2025 20:07
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

Copy link
Contributor

@glessard glessard left a comment

Choose a reason for hiding this comment

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

Thanks! I tried a similar approach recently, but didn't get it to work. Glad this gets us over the hump.

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor enabled auto-merge August 27, 2025 00:09
@DougGregor DougGregor merged commit 75b94d7 into swiftlang:main Aug 27, 2025
3 checks passed
@DougGregor DougGregor deleted the with-unsafe-temporary-alloc-typed-throws branch August 27, 2025 15:52
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.

3 participants