Skip to content

Commit ad37e3f

Browse files
committed
Move Debug for NonNull impl closer to other trait impls
1 parent 3f55794 commit ad37e3f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/libcore/ptr.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2487,13 +2487,6 @@ pub struct NonNull<T: ?Sized> {
24872487
pointer: NonZero<*const T>,
24882488
}
24892489

2490-
#[stable(feature = "nonnull", since = "1.25.0")]
2491-
impl<T: ?Sized> fmt::Debug for NonNull<T> {
2492-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2493-
fmt::Pointer::fmt(&self.as_ptr(), f)
2494-
}
2495-
}
2496-
24972490
/// `NonNull` pointers are not `Send` because the data they reference may be aliased.
24982491
// NB: This impl is unnecessary, but should provide better error messages.
24992492
#[stable(feature = "nonnull", since = "1.25.0")]
@@ -2575,6 +2568,13 @@ impl<T: ?Sized> Copy for NonNull<T> { }
25752568
#[stable(feature = "nonnull", since = "1.25.0")]
25762569
impl<T: ?Sized, U: ?Sized> CoerceUnsized<NonNull<U>> for NonNull<T> where T: Unsize<U> { }
25772570

2571+
#[stable(feature = "nonnull", since = "1.25.0")]
2572+
impl<T: ?Sized> fmt::Debug for NonNull<T> {
2573+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2574+
fmt::Pointer::fmt(&self.as_ptr(), f)
2575+
}
2576+
}
2577+
25782578
#[stable(feature = "nonnull", since = "1.25.0")]
25792579
impl<T: ?Sized> fmt::Pointer for NonNull<T> {
25802580
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

0 commit comments

Comments
 (0)