Files
rust/library/core/src
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
..
2025-09-01 21:38:26 -04:00
2025-11-25 15:16:43 +08:00
2025-11-14 18:23:19 +03:00
fix
2025-11-27 17:55:34 +07:00
2025-09-12 12:39:31 +03:00
2025-11-26 12:38:03 +01:00
2025-11-27 20:18:13 +07:00
2025-09-01 21:38:26 -04:00
2025-10-20 12:20:15 -06:00
2025-09-07 21:16:35 -07:00
2025-11-02 17:29:08 +01:00
2025-11-12 14:33:41 +01:00
2025-10-05 17:45:27 +00:00
2025-11-09 04:17:15 +07:00
2025-11-06 18:08:29 +01:00