Rollup merge of #47840 - penpalperson:master, r=bluss

Marked Debug implementations for primitive types as #[inline]

Change for issue #47792.
This commit is contained in:
kennytm 2018-01-31 16:36:06 +08:00 committed by GitHub
commit 0370717296
2 changed files with 3 additions and 0 deletions

View File

@ -1586,6 +1586,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)
}
@ -1748,6 +1749,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("()")
}

View File

@ -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)
}