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
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
2 changed files with 8 additions and 0 deletions

View File

@ -706,6 +706,10 @@ impl<T: ?Sized> *const T {
}
}
#[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 {

View File

@ -894,6 +894,10 @@ impl<T: ?Sized> *mut T {
}
}
#[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 {