about summary refs log tree commit diff
path: root/library/alloc/src/bstr.rs
AgeCommit message (Collapse)AuthorLines
2025-03-07Fully test the alloc crate through alloctestsbjorn3-20/+0
For the tests that make use of internal implementation details, we include the module to test using #[path] in alloctests now.
2025-01-22Add doc aliases for BStr and BStringJosh Triplett-0/+1
2025-01-12Omit some more `From` impls to avoid inference failuresJosh Triplett-65/+54
2025-01-11Support `no_rc`, `no_sync`, and `no_global_oom_handling`Josh Triplett-0/+9
For now, apply `no_global_oom_handling` to all of library/alloc/src/bstr.rs . We can make it more fine-grained later.
2025-01-11Add `#[cfg(not(test))]` to some impls to work around ↵Josh Triplett-0/+20
https://github.com/rust-lang/rust/issues/135100
2025-01-11Implement `ByteStr` and `ByteString` typesJosh Triplett-0/+683
Approved ACP: https://github.com/rust-lang/libs-team/issues/502 Tracking issue: https://github.com/rust-lang/rust/issues/134915 These types represent human-readable strings that are conventionally, but not always, UTF-8. The `Debug` impl prints non-UTF-8 bytes using escape sequences, and the `Display` impl uses the Unicode replacement character. This is a minimal implementation of these types and associated trait impls. It does not add any helper methods to other types such as `[u8]` or `Vec<u8>`. I've omitted a few implementations of `AsRef`, `AsMut`, `Borrow`, `From`, and `PartialOrd`, when those would be the second implementation for a type (counting the `T` impl) or otherwise may cause inference failures. These impls are important, but we can attempt to add them later in standalone commits, and run them through crater. In addition to the `bstr` feature, I've added a `bstr_internals` feature for APIs provided by `core` for use by `alloc` but not currently intended for stabilization. This API and its implementation are based *heavily* on the `bstr` crate by Andrew Gallant (@BurntSushi).