summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElichai Turkel <elichai.turkel@gmail.com>2019-12-04 15:13:43 +0200
committerElichai Turkel <elichai.turkel@gmail.com>2019-12-04 15:20:47 +0200
commit8be7223145c486f398863ddb55d115bf91651f59 (patch)
treee4d7a7a6d8892d15a5fcf4555fc0a42c4f22c359
parentAuto merge of #65947 - eddyb:fn-abi, r=oli-obk,nagisa (diff)
downloadrust-8be7223145c486f398863ddb55d115bf91651f59.tar.gz
rust-8be7223145c486f398863ddb55d115bf91651f59.tar.bz2
rust-8be7223145c486f398863ddb55d115bf91651f59.tar.xz
Fix docs for formatting delegations
-rw-r--r--src/libcore/fmt/mod.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs
index 4c941e2..e2f49ee 100644
--- a/src/libcore/fmt/mod.rs
+++ b/src/libcore/fmt/mod.rs
@@ -662,7 +662,7 @@ pub trait Display {
662/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 662/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
663/// let val = self.0; 663/// let val = self.0;
664/// 664///
665/// write!(f, "{:o}", val) // delegate to i32's implementation 665/// fmt::Octal::fmt(&val, f) // delegate to i32's implementation
666/// } 666/// }
667/// } 667/// }
668/// 668///
@@ -712,7 +712,7 @@ pub trait Octal {
712/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 712/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
713/// let val = self.0; 713/// let val = self.0;
714/// 714///
715/// write!(f, "{:b}", val) // delegate to i32's implementation 715/// fmt::Binary::fmt(&val, f) // delegate to i32's implementation
716/// } 716/// }
717/// } 717/// }
718/// 718///
@@ -771,7 +771,7 @@ pub trait Binary {
771/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 771/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
772/// let val = self.0; 772/// let val = self.0;
773/// 773///
774/// write!(f, "{:x}", val) // delegate to i32's implementation 774/// fmt::LowerHex::fmt(&val, f) // delegate to i32's implementation
775/// } 775/// }
776/// } 776/// }
777/// 777///
@@ -824,7 +824,7 @@ pub trait LowerHex {
824/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 824/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
825/// let val = self.0; 825/// let val = self.0;
826/// 826///
827/// write!(f, "{:X}", val) // delegate to i32's implementation 827/// fmt::UpperHex::fmt(&val, f) // delegate to i32's implementation
828/// } 828/// }
829/// } 829/// }
830/// 830///
@@ -869,7 +869,8 @@ pub trait UpperHex {
869/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 869/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
870/// // use `as` to convert to a `*const T`, which implements Pointer, which we can use 870/// // use `as` to convert to a `*const T`, which implements Pointer, which we can use
871/// 871///
872/// write!(f, "{:p}", self as *const Length) 872/// let ptr = self as *const Self;
873/// fmt::Pointer::fmt(&ptr, f)
873/// } 874/// }
874/// } 875/// }
875/// 876///