&[T] can be converted into [T; N] but &mut [T] can't #91085
Labels
A-array
Area: `[T; N]`
C-bug
Category: This is a bug.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen: The source is compiled without any error.
Instead, this happened: Compile error as follows.
Is there any reason
TryFrom<&mut '_ [T]> for [T; N]
is not implemented thoughTryFrom<&'_ [T]> for [T; N]
is implemented?Since the implementation is lack, I needed to convert the mutable slice into immutable slice like below.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: