refactor(allocator): improve safety of String::from_utf8_unchecked#9772
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Performance ReportMerging #9772 will create unknown performance changesComparing Summary
Benchmarks breakdown
|
Merge activity
|
…9772) Follow-on after #9656. Add a defence against potential double-free bug in `String::from_utf8_unchecked`. As noted in the comment, this is probably unnecessary, but it doesn't hurt to add this defensive code while new `Vec` implementation is under development. We can remove it again later when we're satisfied we have covered all bases.
6409205 to
a1a8b93
Compare
9ee94df to
d13817e
Compare
|
You handle "unsafe" with great rigor; I am learning from you by observing closely. |
I am just following the greater minds of the authors of the std lib! |

Follow-on after #9656. Add a defence against potential double-free bug in
String::from_utf8_unchecked.As noted in the comment, this is probably unnecessary, but it doesn't hurt to add this defensive code while new
Vecimplementation is under development. We can remove it again later when we're satisfied we have covered all bases.