-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[stdlib] Re-add withContiguousStorageIfAvailable to SubString.UTF8View #29146
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 |
Ok, I definitely need a Swift expert to help me here, because I can't decipher that failure at all. This failure seems to be pretty far away from the change I made, though I admit that that doesn't mean all that much. |
I think the DebugInfo test failure is fixed by #29149, but I’m not sure about the other one. |
@swift-ci please test macOS platform |
Thanks @airspeedswift. Ok, so is our conclusion that the full test suite does not catch the failure that caused us to back this out the first time @milseman? |
The failure was here, which should build the test with the new compiler+stdlib, and run with the old stdlib. Your change should work if alwaysEmitIntoClient is working, IIUC. |
@slavapestov would this be a correct use of alwaysEmitIntoClient? |
Doh, I missed the fact that the test is generic (thanks @aschwaighofer). @Lukasa, can you have a concrete test and a generic one? The concrete one should always pass, but since witness tables are constructed at compile time, the generic one should only pass on bleeding-edge. @lorentey, what would be the preferred way for Cory to differentiate between master and a shipped OS? Would that be something like: let hasSubstringWCSIA: Bool
if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
hasSubstringWCSIA = true
} else {
hasSubstringWCSIA = false
}
... |
c69cada
to
e458538
Compare
@swift-ci please test |
Build failed |
Build failed |
This is a second pass at the original patch, which broke an OS test. Due to an oversight it seems that we never added a withContigousStorageIfAvailable implementation to SubString.UTF8View, which meant that if you sliced a String you lost the ability to get fast access to the backing storage. There's no good reason for this functionality to be missing, so this patch adds it in by delegating to the Slice implementation. Resolves SR-11999.
e458538
to
c6dfea6
Compare
@swift-ci please smoke test |
@swift-ci please test |
Build failed |
Build failed |
That test failure is non-deterministic and has been disabled for now. @swift-ci please test |
Yeah, unfortunately the best we can do at the moment is to tie it to 9999-availability. The 9999s will get (manually) updated into actual version numbers when this reaches production compilers, which isn't exactly what we want, but we don't have a good way to test for custom-stdlib-or-recent-enough-OS yet. :-( |
Come to think of it -- we should just a boolean flag to the stdlib that indicates if it's a production build, and then we can implement the correct condition. (Annoyingly, |
Build failed |
Hmm, the OSX failure here seems unrelated. |
@swift-ci please test |
Ok, where do we stand here now @milseman? Are we happy to try merging again? |
Sorry I missed the notification. LGTM |
This is a second pass at the original patch, which broke an OS test. Originally added in #29094 and reverted in #29128. /cc @milseman
Due to an oversight it seems that we never added a
withContigousStorageIfAvailable implementation to SubString.UTF8View,
which meant that if you sliced a String you lost the ability to get fast
access to the backing storage. There's no good reason for this
functionality to be missing, so this patch adds it in by delegating to
the Slice implementation.
Resolves SR-11999. rdar://problem/58663804