Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRFC: get panics out of std::ffi::CString #840
Conversation
mzabaluev
added some commits
Feb 14, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Alternative: Add a |
This comment has been minimized.
This comment has been minimized.
|
@kennytm I have added a paragraph on why simply adding functions is worse than changing the "shortest name" API. In case of division, a zero divisor arguably is a programmer error. A restriction on NULs in a string, on the other hand, is arbitrary for the value domain in general (a Unicode text with NUL characters is valid). There are also performance concerns regarding the implementation of division. |
This comment has been minimized.
This comment has been minimized.
|
That said, a migration path is probably needed whereby the |
aturon
referenced this pull request
Feb 16, 2015
Closed
CString/ToCStr shouldn't have to fail #16485
This comment has been minimized.
This comment has been minimized.
|
Thanks so much for throwing this together! I'm increasingly in favor of this approach for C strings. cc @wycats @nikomatsakis @brson @huonw @pcwalton I know CString is somewhat common in Servo, do you all have a preference here? |
This comment has been minimized.
This comment has been minimized.
|
Seems fine to me. |
This comment has been minimized.
This comment has been minimized.
|
@aturon +1 from me. |
aturon
referenced this pull request
Feb 18, 2015
Closed
Tracking issue for Get panics out of std::ffi::CString (RFC 840) #22470
aturon
merged commit 10ad3a2
into
rust-lang:master
Feb 18, 2015
This comment has been minimized.
This comment has been minimized.
|
After discussion here and on discuss, we've decided to move forward with this long-requested change. Thanks again, @mzabaluev! We'll try to land this ahead of alpha2 if possible. |
mzabaluev commentedFeb 14, 2015
Bring
CStringin line with other library functions on the failure mode conventions.There should be no panic lurking.
Rendered