about summary refs log tree commit diff
path: root/src/liballoc/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-04-26 06:18:17 +0000
committerbors <bors@rust-lang.org>2017-04-26 06:18:17 +0000
commitdad9814eb0964a92494fef9ce23b80353dc14c46 (patch)
tree4d2fa1e7f6cbdf2c7606bceea1cc8c09a6660239 /src/liballoc/lib.rs
parent4512424391768cfad54efb8ccdb1191f61e338c2 (diff)
parentc66c6e96978cd81130587e9f4d1fa52dc1b183d6 (diff)
downloadrust-dad9814eb0964a92494fef9ce23b80353dc14c46.tar.gz
rust-dad9814eb0964a92494fef9ce23b80353dc14c46.zip
Auto merge of #41258 - clarcharr:str_box_extras, r=Kimundi
More methods for str boxes. (reduce Box<[u8]> ↔ Box<str> transmutes)

This is a follow-up to #41096 that adds safer methods for converting between `Box<str>` and `Box<[u8]>`. They're gated under a different feature from the `&mut str` methods because they may be too niche to include in public APIs, although having them internally helps reduce the number of transmutes the standard library uses.

What's added:

* `From<Box<str>> for Box<[u8]>`
* `<Box<str>>::into_boxed_bytes` (just calls `Into::into`)
* `alloc::str` (new module)
* `from_boxed_utf8` and `from_boxed_utf8_unchecked`, defined in `alloc:str`, exported in `collections::str`
* exports `from_utf8_mut` in `collections::str` (missed from previous PR)
Diffstat (limited to 'src/liballoc/lib.rs')
-rw-r--r--src/liballoc/lib.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs
index c70d82392f9..fee0e1eb260 100644
--- a/src/liballoc/lib.rs
+++ b/src/liballoc/lib.rs
@@ -129,6 +129,8 @@ mod boxed_test;
 pub mod arc;
 pub mod rc;
 pub mod raw_vec;
+#[unstable(feature = "str_box_extras", issue = "41119")]
+pub mod str;
 pub mod oom;
 
 pub use oom::oom;