about summary refs log tree commit diff
path: root/library/core/src/array/mod.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-04-28 17:36:49 +0000
committerMichael Goulet <michael@errs.io>2023-04-28 17:36:49 +0000
commit33871c97ab67d90cfca5c22183f3a4e200d6a976 (patch)
tree2e31168c04fc8a20c2ef6a3b587fd65af55fbe69 /library/core/src/array/mod.rs
parent1c42cb4ef0544fbfaa500216e53382d6b079c001 (diff)
downloadrust-33871c97ab67d90cfca5c22183f3a4e200d6a976.tar.gz
rust-33871c97ab67d90cfca5c22183f3a4e200d6a976.zip
Make sure that signatures aren't accidental refinements
Diffstat (limited to 'library/core/src/array/mod.rs')
-rw-r--r--library/core/src/array/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs
index 98c87b2c393..940558974e6 100644
--- a/library/core/src/array/mod.rs
+++ b/library/core/src/array/mod.rs
@@ -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