-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
slice::fill
: use T
instead of generic arg
#71165
Conversation
Looking at #70752, this method is expected to optimize to mem set, will check if this still works when passing a reference... memset for |
r? @yoshuawuyts |
@lcnr I think there are some gotchas to always taking by reference; replied on the main thread: #70758 (comment) |
slice::fill
: use &T
instead of generic argslice::fill
: use T
instead of generic arg
This now uses edit: tbh I slightly misinterpreted the current state of discussion and there is still some disagreement. |
r? @Amanieu |
Could you avoid cloning the last element and instead move |
done |
Can you check that the code still lowers to a |
Looks good |
@bors r+ |
📌 Commit 902aa62 has been approved by |
`slice::fill`: use `T` instead of generic arg implements rust-lang#70758 (comment) As the discussion in rust-lang#70758 has shifted, I now use `T` instead of `&T`.
Rollup of 5 pull requests Successful merges: - rust-lang#71165 (`slice::fill`: use `T` instead of generic arg) - rust-lang#71314 (Implement RFC 2523, `#[cfg(version(..))]`) - rust-lang#71542 (Implement `confusable_idents` lint.) - rust-lang#71806 (typo) - rust-lang#71813 (Decode qualifs for associated const defaults) Failed merges: r? @ghost
…=m-ou-se Stabilize `core::slice::fill` Tracking issue rust-lang#70758 Stabilizes the `core::slice::fill` API in Rust 1.50, adding a `memset` doc alias so people coming from C/C++ looking for this operation can find it in the docs. This API hasn't seen any changes since we changed the signature in rust-lang#71165, and it seems like the right time to propose stabilization. Thanks! r? `@m-ou-se`
…=m-ou-se Stabilize `core::slice::fill` Tracking issue rust-lang#70758 Stabilizes the `core::slice::fill` API in Rust 1.50, adding a `memset` doc alias so people coming from C/C++ looking for this operation can find it in the docs. This API hasn't seen any changes since we changed the signature in rust-lang#71165, and it seems like the right time to propose stabilization. Thanks! r? ``@m-ou-se``
…=m-ou-se Stabilize `core::slice::fill` Tracking issue rust-lang#70758 Stabilizes the `core::slice::fill` API in Rust 1.50, adding a `memset` doc alias so people coming from C/C++ looking for this operation can find it in the docs. This API hasn't seen any changes since we changed the signature in rust-lang#71165, and it seems like the right time to propose stabilization. Thanks! r? `@m-ou-se`
implements #70758 (comment)
As the discussion in #70758 has shifted, I now use
T
instead of&T
.