Skip to content

[stdlib, 6.2] add missing computed properties (again) #82422

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

Conversation

glessard
Copy link
Contributor

@glessard glessard commented Jun 23, 2025

SE-0467 adds an unsafe mutableSpan property to UnsafeMutableBufferPointer, and a similar mutableBytes property to UnsafeMutableRawBufferPointer. Implemented here.
(Requires #82269 and #82381, reinstates #82284 after its #82351.)

Scope: Addition only.

Radar/SR Issue: rdar://153768604

main PR: #82277

Risk: Low.

Testing: Added unit tests

Reviewer: @Azoy, @stephentyrone

@glessard glessard requested a review from a team as a code owner June 23, 2025 18:31
@glessard
Copy link
Contributor Author

@swift-ci please test

@glessard glessard changed the title Rdar153219174 umbp mutable span 62 [stdlib, 6.2] add missing computed properties (again) Jun 23, 2025
@glessard glessard added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.2 labels Jun 23, 2025
@@ -933,6 +933,8 @@ Added: _$ss10ArraySliceV11mutableSpans07MutableD0VyxGvr
Added: _$ss15ContiguousArrayV11mutableSpans07MutableD0VyxGvr
Added: _$ss11InlineArrayVsRi__rlE11mutableSpans07MutableD0Vyq_Gvr
Added: _$ss15CollectionOfOneV11mutableSpans07MutableE0VyxGvr
Added: _$sSrsRi_zrlE11mutableSpans07MutableB0VyxGvr
Added: _$sSw12mutableBytess14MutableRawSpanVvr
Copy link
Member

Choose a reason for hiding this comment

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

Hmm. Could the property itself have been @_alwaysEmitIntoClient to avoid these symbols, or no?

Copy link
Contributor Author

@glessard glessard Jun 25, 2025

Choose a reason for hiding this comment

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

Unfortunately computed properties for escapable types produce symbols to support keypaths. This is fixed for non-escapable types: their computed properties do not produce symbols.
Actually that's right, moving @_alwaysEmitIntoClient to the property rather than the accessor makes the symbol go away for these.

Copy link
Member

Choose a reason for hiding this comment

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

Yay!

Copy link
Member

Choose a reason for hiding this comment

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

@glessard can you follow up with a PR to do that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of course! I've started searching for how many other span/mutableSpan/etc symbols I missed this way…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: followup here.

@glessard glessard merged commit 484d7c7 into swiftlang:release/6.2 Jun 25, 2025
5 checks passed
@glessard glessard deleted the rdar153219174-UMBP-mutableSpan-62 branch June 27, 2025 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants