-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[stdlib] Replace precondition
with the internal _precondition
#40056
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
[stdlib] Replace precondition
with the internal _precondition
#40056
Conversation
@lorentey There are 4 occurrences in
I tried casting the string to a static string but that didn't work. Do you have any idea why this is happening? |
That's because the internal assertions are (intentionally) only taking compile-time constant strings, not dynamic ones. It looks like those ArrayBuffer preconditions serve a similar purpose as We do want the trap message to be dynamically constructed (so that we can print the types involved) in this case, so we can't use |
@swift-ci test |
Build failed |
@swift-ci please test |
@swift-ci please smoke benchmark |
Performance (x86_64): -O
Code size: -O
Performance (x86_64): -Osize
Code size: -Osize
Performance (x86_64): -Onone
Code size: -swiftlibsHow to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
Build failed |
Here is a commit where I switched the |
The Linux test failed during testing of |
@swift-ci Please clean test Linux platform |
@HassanElDesouky It looks like the change to |
@glessard That's good news! I can cherry pick the last commit in a separate PR but I'm not free today so I'll do that tomorrow, inshallah. |
549a78e
to
e87a3e3
Compare
@glessard I cherry picked the sort optimization commit and opened a new PR for it. I also removed that commit from this branch so now this PR is only responsible for replacing |
@swift-ci please smoke test |
@HassanElDesouky Thanks for helping with these changes! |
Replace
precondition
with the internal_precondition
in several files instdlib/public/core
.cc @lorentey, @glessard