ptr: implement "const_slice_ptr" and "mut_slice_ptr" lang items

This commit is contained in:
Matthias Schiffer
2020-04-13 20:57:35 +02:00
parent 0c17b3f4f4
commit 43612e21a6
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -706,6 +706,10 @@ pub fn align_offset(self, align: usize) -> usize
}
}
#[cfg(not(bootstrap))]
#[lang = "const_slice_ptr"]
impl<T> *const [T] {}
// Equality for pointers
#[stable(feature = "rust1", since = "1.0.0")]
impl<T: ?Sized> PartialEq for *const T {
+4
View File
@@ -894,6 +894,10 @@ pub fn align_offset(self, align: usize) -> usize
}
}
#[cfg(not(bootstrap))]
#[lang = "mut_slice_ptr"]
impl<T> *mut [T] {}
// Equality for pointers
#[stable(feature = "rust1", since = "1.0.0")]
impl<T: ?Sized> PartialEq for *mut T {