-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Make String(unsafeUninitializedCapacity:initializingUTF8With:) public #30106
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
Conversation
@swift-ci please test |
Build failed |
@swift-ci please test and merge |
1 similar comment
@swift-ci please test and merge |
Should the public initializer include the |
Oh did I get that backwards? For some reason I thought we'd ended up removing it. Thanks for catching that! Also what is swift-ci doing :( |
This comment has been minimized.
This comment has been minimized.
@@ -476,7 +476,8 @@ extension String { | |||
/// - buffer: A buffer covering uninitialized memory with room for the | |||
/// specified number of UTF-8 code units. | |||
@inline(__always) | |||
internal init( | |||
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *) | |||
public init( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the proposal:
public init(
unsafeUninitializedCapacity capacity: Int,
initializingUTF8With initializer: (
_ buffer: UnsafeMutableBufferPointer<UInt8>,
) throws -> Int
) rethrows
@swift-ci please test and merge |
@swift-ci please smoke test and merge |
The |
Huh when did lowercased() and friends start using this, that's neat |
Also I have to work around availability >.< |
8afb1ba
to
b9ddaa6
Compare
@swift-ci please test and merge |
The public and internal initializers are And if the callers I listed above ( The "test and merge" failed.
You could try a "test" only, and merge manually if that works. |
Yes, inline always but not inlinable was intentional here. I want to try taking that off at some point, but getting the SmallString part inlined as much as possible is important (originally I wanted to make it inlinable, but SmallString isn't ABI). I tried using the public initializer in lowercased() and friends but it still got upset about availability :( test only is a good idea, let's try that |
@swift-ci please test |
Build failed |
Build failed |
All checks have passed! |
No description provided.