Commit Graph

7 Commits

Author SHA1 Message Date
León Orell Valerian Liehr
b9fd2bccfa Rollup merge of #143829 - a1phyr:trim_borrowed_buf, r=ChrisDenton
Trim `BorrowedCursor` API

This PR removes some method from the unstable `BorrowedCursor` type. A rational for each change can be found in the message of each commit.

I don't think that an ACP is required for this, please tell me if it is not the case.

Cc rust-lang/rust#78485 rust-lang/rust#117693
2025-07-17 03:58:32 +02:00
Benoît du Garreau
65df66831f core: Change BorrowedCursor::written's origin
This enable removing the `start` field, so `BorrowedCursor` fits in a
single register. Because `written` is almost always used in difference
with another call, this changes nothing else in practice.
2025-07-09 18:11:27 +02:00
Benoît du Garreau
34555f1b0b core: Remove BorrowedCursor::uninit_mut
I assume that this method was there for completeness, but there is
hardly any useful use of it: the buffer it gave was not always connected
to the start of the cursor and its use required `unsafe` anyway to mark
the bytes as initialized.
2025-07-09 18:11:26 +02:00
Benoît du Garreau
803b4d2622 core: Remove BorrowedCursor::init_ref method
This method was not really useful: at no point one would only need to
read the initialized part of the cursor without mutating it.
2025-07-09 18:11:26 +02:00
Benoît du Garreau
136d24fd7f core: Add BorrowedCursor::with_unfilled_buf
Implementation of https://github.com/rust-lang/libs-team/issues/367.

This mainly adds `BorrowedCursor::with_unfilled_buf`, with enables using
the unfilled part of a cursor as a `BorrowedBuf`.

Note that unlike the ACP, `BorrowedCursor::unfilled_buf` was moved to a
`From` conversion. This is more consistent with other ways of creating a
`BorrowedBuf` and hides a bit this conversion that requires unsafe code
to be used correctly.
2025-07-01 14:03:54 +02:00
Eric Huss
0aa634e71a Migrate coretests to Rust 2024 2025-02-13 13:10:21 -08:00
bjorn3
b6a3841942 Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00