Alex Crichton
25d5a3a194
rollup merge of #20507 : alexcrichton/issue-20444
...
This commit is an implementation of [RFC 494][rfc] which removes the entire
`std::c_vec` module and redesigns the `std::c_str` module as `std::ffi`.
[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0494-c_str-and-c_vec-stability.md
The interface of the new `CString` is outlined in the linked RFC, the primary
changes being:
* The `ToCStr` trait is gone, meaning the `with_c_str` and `to_c_str` methods
are now gone. These two methods are replaced with a `CString::from_slice`
method.
* The `CString` type is now just a wrapper around `Vec<u8>` with a static
guarantee that there is a trailing nul byte with no internal nul bytes. This
means that `CString` now implements `Deref<Target = [c_char]>`, which is where
it gains most of its methods from. A few helper methods are added to acquire a
slice of `u8` instead of `c_char`, as well as including a slice with the
trailing nul byte if necessary.
* All usage of non-owned `CString` values is now done via two functions inside
of `std::ffi`, called `c_str_to_bytes` and `c_str_to_bytes_with_nul`. These
functions are now the one method used to convert a `*const c_char` to a Rust
slice of `u8`.
Many more details, including newly deprecated methods, can be found linked in
the RFC. This is a:
[breaking-change]
Closes #20444
2015-01-05 18:37:22 -08:00
..
2014-03-31 15:47:36 -07:00
2014-10-19 12:59:40 -07:00
2014-12-30 09:36:23 -05:00
2015-01-03 23:43:57 -08:00
2014-03-31 15:47:36 -07:00
2014-03-31 15:47:36 -07:00
2014-05-24 21:48:10 -07:00
2014-03-31 15:47:36 -07:00
2014-03-31 15:47:36 -07:00
2014-05-24 21:48:10 -07:00
2014-03-31 15:47:36 -07:00
2014-05-13 17:24:07 -07:00
2014-10-09 09:44:52 -07:00
2015-01-05 17:22:16 -05:00
2014-06-23 23:28:28 -07:00
2015-01-05 17:22:16 -05:00
2014-10-29 11:43:07 -04:00
2015-01-05 17:22:16 -05:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-29 23:24:04 -04:00
2015-01-02 04:06:09 -05:00
2014-10-21 23:52:00 -04:00
2014-10-19 12:59:40 -07:00
2014-07-05 12:46:42 -07:00
2014-07-05 12:46:42 -07:00
2014-07-05 12:46:42 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-04-06 15:55:43 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-06-12 18:39:01 +02:00
2014-04-14 21:00:31 +05:30
2014-05-24 21:48:10 -07:00
2015-01-03 15:16:10 +00:00
2014-04-14 21:00:31 +05:30
2014-08-20 21:02:24 -04:00
2014-10-19 12:59:40 -07:00
2014-10-09 17:19:53 -04:00
2014-04-04 15:57:45 -07:00
2014-05-30 15:52:24 -07:00
2014-04-20 13:41:18 +12:00
2014-11-11 15:06:54 -08:00
2014-10-19 12:59:40 -07:00
2014-09-13 02:07:39 -07:00
2015-01-05 17:22:16 -05:00
2014-12-08 13:47:44 -05:00
2015-01-05 17:22:16 -05:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-04-14 21:00:31 +05:30
2014-03-31 19:50:51 -07:00
2014-10-29 11:43:07 -04:00
2014-04-14 21:00:31 +05:30
2014-10-19 12:59:40 -07:00
2014-04-04 09:31:44 -07:00
2014-05-11 01:13:02 -07:00
2014-04-14 21:00:31 +05:30
2014-03-31 19:50:51 -07:00
2014-10-02 17:02:03 +03:00
2014-11-25 11:02:47 -08:00
2015-01-01 11:51:45 -05:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-04-27 20:35:51 -07:00
2014-10-02 17:02:15 +03:00
2014-08-27 21:46:52 -04:00
2014-03-31 19:50:51 -07:00
2014-11-20 00:56:50 +01:00
2014-06-29 11:47:58 -07:00
2014-06-24 17:18:48 -07:00
2014-03-31 19:50:51 -07:00
2014-03-31 19:50:51 -07:00
2014-05-06 16:45:21 -07:00
2014-08-23 12:16:04 -07:00
2014-11-03 15:08:20 -08:00
2014-04-14 21:00:31 +05:30
2014-04-10 15:22:00 -07:00
2014-04-10 15:22:00 -07:00
2014-09-30 16:22:55 +02:00
2014-04-16 11:42:22 -07:00
2014-04-16 11:42:22 -07:00
2014-08-23 12:16:04 -07:00
2014-10-09 09:44:52 -07:00
2014-08-23 12:16:04 -07:00
2014-04-30 19:24:21 -07:00
2014-11-25 11:02:47 -08:00
2014-08-23 12:16:04 -07:00
2014-05-27 09:04:08 -07:00
2014-12-08 13:47:44 -05:00
2014-08-25 12:48:35 -07:00
2015-01-03 09:34:05 -05:00
2014-08-25 05:01:51 -07:00
2014-12-17 23:00:32 +01:00
2014-09-30 23:53:15 +03:00
2014-10-09 09:44:52 -07:00
2015-01-01 22:02:59 -08:00
2014-11-01 19:07:51 -07:00
2014-12-17 23:00:32 +01:00
2014-11-01 15:24:42 -07:00
2014-11-18 12:32:38 -05:00
2014-12-12 03:38:11 +09:00
2014-04-14 21:00:31 +05:30
2014-12-08 13:47:44 -05:00
2014-03-18 13:48:12 -07:00
2015-01-05 08:00:13 -08:00
2014-12-18 12:09:07 -05:00
2014-10-19 12:59:40 -07:00
2014-12-18 12:09:07 -05:00
2014-12-18 12:09:07 -05:00
2014-11-12 09:18:35 -08:00
2015-01-05 17:22:16 -05:00
2014-12-18 12:09:07 -05:00
2014-12-18 12:09:07 -05:00
2014-12-18 12:09:07 -05:00
2014-10-30 19:02:11 -07:00
2014-10-30 19:02:11 -07:00
2014-12-08 13:47:44 -05:00
2015-01-02 12:08:36 -05:00
2014-04-14 21:00:31 +05:30
2014-11-20 00:56:50 +01:00
2014-11-20 00:56:50 +01:00
2015-01-03 09:34:05 -05:00
2014-04-14 21:00:31 +05:30
2014-04-14 21:00:31 +05:30
2014-09-22 20:05:45 -07:00
2015-01-02 12:19:59 -05:00
2014-08-20 21:02:23 -04:00
2014-11-23 23:37:16 -08:00
2014-09-22 20:05:45 -07:00
2014-08-14 13:24:50 -07:00
2014-03-31 18:59:46 -07:00
2014-03-31 15:47:36 -07:00
2014-08-14 13:24:50 -07:00
2014-10-29 11:43:07 -04:00
2014-07-10 07:51:50 -07:00
2014-10-28 15:55:37 +11:00
2014-09-05 09:18:57 -07:00
2014-09-05 09:18:57 -07:00
2014-09-05 09:18:57 -07:00
2014-11-07 12:04:28 -08:00
2014-11-07 12:04:28 -08:00
2014-09-17 18:53:54 +12:00
2014-10-19 12:59:40 -07:00
2015-01-03 23:43:57 -08:00
2014-04-14 21:00:31 +05:30
2014-11-20 00:56:50 +01:00
2014-11-20 00:56:50 +01:00
2014-03-31 15:47:36 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-11-03 15:08:20 -08:00
2014-11-03 15:08:20 -08:00
2014-08-17 01:39:10 -07:00
2014-08-23 12:16:04 -07:00
2014-10-19 12:59:40 -07:00
2014-03-31 15:47:36 -07:00
2014-03-31 15:47:36 -07:00
2015-01-03 16:29:19 -05:00
2014-08-07 08:54:38 -07:00
2014-12-14 11:11:55 -05:00
2015-01-01 16:11:32 +13:00
2015-01-03 16:29:19 -05:00
2014-04-16 08:12:43 -07:00
2014-10-31 20:43:35 -07:00
2014-10-29 11:43:07 -04:00
2014-08-14 14:14:26 -07:00
2014-11-17 07:35:51 -08:00
2014-06-17 11:44:00 -07:00
2014-06-28 11:53:58 -07:00
2014-07-04 17:07:31 -07:00
2014-12-08 13:47:44 -05:00