Make sure that signatures aren't accidental refinements
This commit is contained in:
@@ -248,7 +248,7 @@ where
|
||||
impl<'a, T, const N: usize> TryFrom<&'a [T]> for &'a [T; N] {
|
||||
type Error = TryFromSliceError;
|
||||
|
||||
fn try_from(slice: &[T]) -> Result<&[T; N], TryFromSliceError> {
|
||||
fn try_from(slice: &'a [T]) -> Result<&'a [T; N], TryFromSliceError> {
|
||||
if slice.len() == N {
|
||||
let ptr = slice.as_ptr() as *const [T; N];
|
||||
// SAFETY: ok because we just checked that the length fits
|
||||
@@ -275,7 +275,7 @@ impl<'a, T, const N: usize> TryFrom<&'a [T]> for &'a [T; N] {
|
||||
impl<'a, T, const N: usize> TryFrom<&'a mut [T]> for &'a mut [T; N] {
|
||||
type Error = TryFromSliceError;
|
||||
|
||||
fn try_from(slice: &mut [T]) -> Result<&mut [T; N], TryFromSliceError> {
|
||||
fn try_from(slice: &'a mut [T]) -> Result<&'a mut [T; N], TryFromSliceError> {
|
||||
if slice.len() == N {
|
||||
let ptr = slice.as_mut_ptr() as *mut [T; N];
|
||||
// SAFETY: ok because we just checked that the length fits
|
||||
|
||||
Reference in New Issue
Block a user