Skip to content
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

Tracking Issue for const_copy_from_slice #131415

Open
1 of 3 tasks
okaneco opened this issue Oct 8, 2024 · 1 comment
Open
1 of 3 tasks

Tracking Issue for const_copy_from_slice #131415

okaneco opened this issue Oct 8, 2024 · 1 comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@okaneco
Copy link
Contributor

okaneco commented Oct 8, 2024

Feature gate: #![feature(const_copy_from_slice)]

This is a tracking issue for using <[T]>::copy_from_slice in const.

Public API

impl<T> [T] {
    pub const fn copy_from_slice(&mut self, src: &[T])
    where
        T: Copy;
}

Steps / History

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

@okaneco okaneco added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Oct 8, 2024
@bjoernager
Copy link
Contributor

The referenced function should be <[T]>::copy_from_slice (method of [T]) instead of slice::copy_from_slice (function in core::slice).

jhpratt added a commit to jhpratt/rust that referenced this issue Dec 2, 2024
Mark `slice::copy_from_slice` unstably const

Tracking issue rust-lang#131415

I used `const_eval_select` for runtime and const panic functions because const formatting isn't available yet.
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Dec 2, 2024
Rollup merge of rust-lang#131416 - okaneco:const_copy, r=RalfJung

Mark `slice::copy_from_slice` unstably const

Tracking issue rust-lang#131415

I used `const_eval_select` for runtime and const panic functions because const formatting isn't available yet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants