rust/library/std
Matthias Krüger 45b2a711b1
Rollup merge of #148937 - joshtriplett:borrowed-buf-no-init-tracking, r=Amanieu
Remove initialized-bytes tracking from `BorrowedBuf` and `BorrowedCursor`

As discussed extensively in libs-api, the initialized-bytes tracking primarily benefits calls to `read_buf` that end up initializing the buffer and calling `read`, at the expense of calls to `read_buf` that *don't* need to initialize the buffer. Essentially, this optimizes for the past at the expense of the future. If people observe performance issues using `read_buf` (or something that calls it) with a given `Read` impl, they can fix those performance issues by implementing `read_buf` for that `Read`.

Update the documentation to stop talking about initialized-but-unfilled bytes.

Remove all functions that just deal with those bytes and their tracking, and remove usage of those methods.

Remove `BorrowedCursor::advance` as there's no longer a safe case for advancing within initialized-but-unfilled bytes. Rename `BorrowedCursor::advance_unchecked` to `advance`.

Update tests.

r? ``@Amanieu``
2025-12-03 07:36:12 +01:00
..
benches benchmark path.components() iteration 2025-10-25 14:46:58 +02:00
src Rollup merge of #148937 - joshtriplett:borrowed-buf-no-init-tracking, r=Amanieu 2025-12-03 07:36:12 +01:00
tests fix 2025-11-27 17:55:34 +07:00
build.rs Add Motor OS std library port 2025-10-08 08:57:58 -07:00
Cargo.toml library: upgrade to hashbrown v0.16.1 2025-11-20 11:12:31 -08:00