about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorpenpalperson <16357077+penpalperson@users.noreply.github.com>2018-01-28 21:55:05 -0700
committerpenpalperson <16357077+penpalperson@users.noreply.github.com>2018-01-28 21:55:05 -0700
commit81e49597bf3fe4fb2dfe9f60325079ff6bb916a0 (patch)
tree1e20ef8f6bb4acc5592f26c5959c60e5ede96f18 /src/libcore
parent771873c84137842c78cfc39625613b95867d21ef (diff)
downloadrust-81e49597bf3fe4fb2dfe9f60325079ff6bb916a0.tar.gz
rust-81e49597bf3fe4fb2dfe9f60325079ff6bb916a0.zip
Added inline to fmt for debug implementations of primitives.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/array.rs1
-rw-r--r--src/libcore/fmt/float.rs1
-rw-r--r--src/libcore/fmt/mod.rs10
-rw-r--r--src/libcore/fmt/num.rs1
-rw-r--r--src/libcore/ptr.rs1
5 files changed, 14 insertions, 0 deletions
diff --git a/src/libcore/array.rs b/src/libcore/array.rs
index 3d24f8902bd..28f1da27bdb 100644
--- a/src/libcore/array.rs
+++ b/src/libcore/array.rs
@@ -185,6 +185,7 @@ macro_rules! array_impls {
 
             #[stable(feature = "rust1", since = "1.0.0")]
             impl<T: fmt::Debug> fmt::Debug for [T; $N] {
+                #[inline]
                 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
                     fmt::Debug::fmt(&&self[..], f)
                 }
diff --git a/src/libcore/fmt/float.rs b/src/libcore/fmt/float.rs
index 03e7a9a49d8..24ffe8c6888 100644
--- a/src/libcore/fmt/float.rs
+++ b/src/libcore/fmt/float.rs
@@ -125,6 +125,7 @@ macro_rules! floating {
     ($ty:ident) => (
         #[stable(feature = "rust1", since = "1.0.0")]
         impl Debug for $ty {
+            #[inline]
             fn fmt(&self, fmt: &mut Formatter) -> Result {
                 float_to_decimal_common(fmt, self, true, 1)
             }
diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs
index 65aacb23bd7..b4d23d153d8 100644
--- a/src/libcore/fmt/mod.rs
+++ b/src/libcore/fmt/mod.rs
@@ -1558,10 +1558,12 @@ macro_rules! fmt_refs {
         $(
         #[stable(feature = "rust1", since = "1.0.0")]
         impl<'a, T: ?Sized + $tr> $tr for &'a T {
+            #[inline]
             fn fmt(&self, f: &mut Formatter) -> Result { $tr::fmt(&**self, f) }
         }
         #[stable(feature = "rust1", since = "1.0.0")]
         impl<'a, T: ?Sized + $tr> $tr for &'a mut T {
+            #[inline]
             fn fmt(&self, f: &mut Formatter) -> Result { $tr::fmt(&**self, f) }
         }
         )*
@@ -1586,6 +1588,7 @@ impl Display for ! {
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl Debug for bool {
+    #[inline]
     fn fmt(&self, f: &mut Formatter) -> Result {
         Display::fmt(self, f)
     }
@@ -1600,6 +1603,7 @@ impl Display for bool {
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl Debug for str {
+    #[inline]
     fn fmt(&self, f: &mut Formatter) -> Result {
         f.write_char('"')?;
         let mut from = 0;
@@ -1628,6 +1632,7 @@ impl Display for str {
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl Debug for char {
+    #[inline]
     fn fmt(&self, f: &mut Formatter) -> Result {
         f.write_char('\'')?;
         for c in self.escape_debug() {
@@ -1701,10 +1706,12 @@ impl<'a, T: ?Sized> Pointer for &'a mut T {
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T: ?Sized> Debug for *const T {
+    #[inline]
     fn fmt(&self, f: &mut Formatter) -> Result { Pointer::fmt(self, f) }
 }
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T: ?Sized> Debug for *mut T {
+    #[inline]
     fn fmt(&self, f: &mut Formatter) -> Result { Pointer::fmt(self, f) }
 }
 
@@ -1718,6 +1725,7 @@ macro_rules! tuple {
         #[stable(feature = "rust1", since = "1.0.0")]
         impl<$($name:Debug),*> Debug for ($($name,)*) where last_type!($($name,)+): ?Sized {
             #[allow(non_snake_case, unused_assignments, deprecated)]
+            #[inline]
             fn fmt(&self, f: &mut Formatter) -> Result {
                 let mut builder = f.debug_tuple("");
                 let ($(ref $name,)*) = *self;
@@ -1741,6 +1749,7 @@ tuple! { T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, }
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T: Debug> Debug for [T] {
+    #[inline]
     fn fmt(&self, f: &mut Formatter) -> Result {
         f.debug_list().entries(self.iter()).finish()
     }
@@ -1748,6 +1757,7 @@ impl<T: Debug> Debug for [T] {
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl Debug for () {
+    #[inline]
     fn fmt(&self, f: &mut Formatter) -> Result {
         f.pad("()")
     }
diff --git a/src/libcore/fmt/num.rs b/src/libcore/fmt/num.rs
index ee989854a37..2992e7cf8db 100644
--- a/src/libcore/fmt/num.rs
+++ b/src/libcore/fmt/num.rs
@@ -157,6 +157,7 @@ macro_rules! debug {
     ($T:ident) => {
         #[stable(feature = "rust1", since = "1.0.0")]
         impl fmt::Debug for $T {
+            #[inline]
             fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
                 fmt::Display::fmt(self, f)
             }
diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs
index fab5832d905..3e162afd649 100644
--- a/src/libcore/ptr.rs
+++ b/src/libcore/ptr.rs
@@ -2202,6 +2202,7 @@ macro_rules! fnptr_impls_safety_abi {
 
         #[stable(feature = "fnptr_impls", since = "1.4.0")]
         impl<Ret, $($Arg),*> fmt::Debug for $FnTy {
+            #[inline]
             fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
                 fmt::Pointer::fmt(&(*self as *const ()), f)
             }