Skip to content

Commit 81e4959

Browse files
author
penpalperson
committed
Added inline to fmt for debug implementations of primitives.
1 parent 771873c commit 81e4959

File tree

5 files changed

+14
-0
lines changed

5 files changed

+14
-0
lines changed

src/libcore/array.rs

+1
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ macro_rules! array_impls {
185185

186186
#[stable(feature = "rust1", since = "1.0.0")]
187187
impl<T: fmt::Debug> fmt::Debug for [T; $N] {
188+
#[inline]
188189
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
189190
fmt::Debug::fmt(&&self[..], f)
190191
}

src/libcore/fmt/float.rs

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ macro_rules! floating {
125125
($ty:ident) => (
126126
#[stable(feature = "rust1", since = "1.0.0")]
127127
impl Debug for $ty {
128+
#[inline]
128129
fn fmt(&self, fmt: &mut Formatter) -> Result {
129130
float_to_decimal_common(fmt, self, true, 1)
130131
}

src/libcore/fmt/mod.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1558,10 +1558,12 @@ macro_rules! fmt_refs {
15581558
$(
15591559
#[stable(feature = "rust1", since = "1.0.0")]
15601560
impl<'a, T: ?Sized + $tr> $tr for &'a T {
1561+
#[inline]
15611562
fn fmt(&self, f: &mut Formatter) -> Result { $tr::fmt(&**self, f) }
15621563
}
15631564
#[stable(feature = "rust1", since = "1.0.0")]
15641565
impl<'a, T: ?Sized + $tr> $tr for &'a mut T {
1566+
#[inline]
15651567
fn fmt(&self, f: &mut Formatter) -> Result { $tr::fmt(&**self, f) }
15661568
}
15671569
)*
@@ -1586,6 +1588,7 @@ impl Display for ! {
15861588

15871589
#[stable(feature = "rust1", since = "1.0.0")]
15881590
impl Debug for bool {
1591+
#[inline]
15891592
fn fmt(&self, f: &mut Formatter) -> Result {
15901593
Display::fmt(self, f)
15911594
}
@@ -1600,6 +1603,7 @@ impl Display for bool {
16001603

16011604
#[stable(feature = "rust1", since = "1.0.0")]
16021605
impl Debug for str {
1606+
#[inline]
16031607
fn fmt(&self, f: &mut Formatter) -> Result {
16041608
f.write_char('"')?;
16051609
let mut from = 0;
@@ -1628,6 +1632,7 @@ impl Display for str {
16281632

16291633
#[stable(feature = "rust1", since = "1.0.0")]
16301634
impl Debug for char {
1635+
#[inline]
16311636
fn fmt(&self, f: &mut Formatter) -> Result {
16321637
f.write_char('\'')?;
16331638
for c in self.escape_debug() {
@@ -1701,10 +1706,12 @@ impl<'a, T: ?Sized> Pointer for &'a mut T {
17011706

17021707
#[stable(feature = "rust1", since = "1.0.0")]
17031708
impl<T: ?Sized> Debug for *const T {
1709+
#[inline]
17041710
fn fmt(&self, f: &mut Formatter) -> Result { Pointer::fmt(self, f) }
17051711
}
17061712
#[stable(feature = "rust1", since = "1.0.0")]
17071713
impl<T: ?Sized> Debug for *mut T {
1714+
#[inline]
17081715
fn fmt(&self, f: &mut Formatter) -> Result { Pointer::fmt(self, f) }
17091716
}
17101717

@@ -1718,6 +1725,7 @@ macro_rules! tuple {
17181725
#[stable(feature = "rust1", since = "1.0.0")]
17191726
impl<$($name:Debug),*> Debug for ($($name,)*) where last_type!($($name,)+): ?Sized {
17201727
#[allow(non_snake_case, unused_assignments, deprecated)]
1728+
#[inline]
17211729
fn fmt(&self, f: &mut Formatter) -> Result {
17221730
let mut builder = f.debug_tuple("");
17231731
let ($(ref $name,)*) = *self;
@@ -1741,13 +1749,15 @@ tuple! { T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, }
17411749

17421750
#[stable(feature = "rust1", since = "1.0.0")]
17431751
impl<T: Debug> Debug for [T] {
1752+
#[inline]
17441753
fn fmt(&self, f: &mut Formatter) -> Result {
17451754
f.debug_list().entries(self.iter()).finish()
17461755
}
17471756
}
17481757

17491758
#[stable(feature = "rust1", since = "1.0.0")]
17501759
impl Debug for () {
1760+
#[inline]
17511761
fn fmt(&self, f: &mut Formatter) -> Result {
17521762
f.pad("()")
17531763
}

src/libcore/fmt/num.rs

+1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ macro_rules! debug {
157157
($T:ident) => {
158158
#[stable(feature = "rust1", since = "1.0.0")]
159159
impl fmt::Debug for $T {
160+
#[inline]
160161
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
161162
fmt::Display::fmt(self, f)
162163
}

src/libcore/ptr.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2202,6 +2202,7 @@ macro_rules! fnptr_impls_safety_abi {
22022202

22032203
#[stable(feature = "fnptr_impls", since = "1.4.0")]
22042204
impl<Ret, $($Arg),*> fmt::Debug for $FnTy {
2205+
#[inline]
22052206
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
22062207
fmt::Pointer::fmt(&(*self as *const ()), f)
22072208
}

0 commit comments

Comments
 (0)