Skip to content

Commit 2d3e2b5

Browse files
committed
Make <*const T>::is_null() and al work with T: ?DynSized.
1 parent c0cf410 commit 2d3e2b5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/libcore/ptr.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ use nonzero::NonZero;
2727

2828
use cmp::Ordering::{self, Less, Equal, Greater};
2929

30+
#[cfg(stage0)]
31+
use marker::Sized as DynSized;
32+
#[cfg(not(stage0))]
33+
use marker::DynSized;
34+
3035
// FIXME #19649: intrinsic docs don't render, so these have no docs :(
3136

3237
#[stable(feature = "rust1", since = "1.0.0")]
@@ -473,7 +478,7 @@ pub unsafe fn write_volatile<T>(dst: *mut T, src: T) {
473478
}
474479

475480
#[lang = "const_ptr"]
476-
impl<T: ?Sized> *const T {
481+
impl<T: ?DynSized> *const T {
477482
/// Returns `true` if the pointer is null.
478483
///
479484
/// # Examples
@@ -1105,7 +1110,7 @@ impl<T: ?Sized> *const T {
11051110
}
11061111

11071112
#[lang = "mut_ptr"]
1108-
impl<T: ?Sized> *mut T {
1113+
impl<T: ?DynSized> *mut T {
11091114
/// Returns `true` if the pointer is null.
11101115
///
11111116
/// # Examples

0 commit comments

Comments
 (0)