about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2018-01-21 09:48:58 +0100
committerSimon Sapin <simon.sapin@exyr.org>2018-01-21 09:48:58 +0100
commitad37e3fc01b533994dfb30f703c28ecdbf66fe10 (patch)
tree3141ba94f860047d26b2cbca928efad04ec6b81b
parent3f557947abf99b262aab994e896522c76329d315 (diff)
downloadrust-ad37e3fc01b533994dfb30f703c28ecdbf66fe10.tar.gz
rust-ad37e3fc01b533994dfb30f703c28ecdbf66fe10.zip
Move Debug for NonNull impl closer to other trait impls
-rw-r--r--src/libcore/ptr.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs
index 607e4a1a9fa..c3b7c4f5d22 100644
--- a/src/libcore/ptr.rs
+++ b/src/libcore/ptr.rs
@@ -2487,13 +2487,6 @@ pub struct NonNull<T: ?Sized> {
     pointer: NonZero<*const T>,
 }
 
-#[stable(feature = "nonnull", since = "1.25.0")]
-impl<T: ?Sized> fmt::Debug for NonNull<T> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        fmt::Pointer::fmt(&self.as_ptr(), f)
-    }
-}
-
 /// `NonNull` pointers are not `Send` because the data they reference may be aliased.
 // NB: This impl is unnecessary, but should provide better error messages.
 #[stable(feature = "nonnull", since = "1.25.0")]
@@ -2576,6 +2569,13 @@ impl<T: ?Sized> Copy for NonNull<T> { }
 impl<T: ?Sized, U: ?Sized> CoerceUnsized<NonNull<U>> for NonNull<T> where T: Unsize<U> { }
 
 #[stable(feature = "nonnull", since = "1.25.0")]
+impl<T: ?Sized> fmt::Debug for NonNull<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        fmt::Pointer::fmt(&self.as_ptr(), f)
+    }
+}
+
+#[stable(feature = "nonnull", since = "1.25.0")]
 impl<T: ?Sized> fmt::Pointer for NonNull<T> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         fmt::Pointer::fmt(&self.as_ptr(), f)