diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2016-06-22 09:51:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-06-22 09:51:06 +0100 |
| commit | e4ff7f0107a1c612285e6c3c265f227830761e26 (patch) | |
| tree | 76f53fed4651037b68e601f06e553dc6cc46f1b5 | |
| parent | 66b82beb609aa65b76b93a43e6aa1f507dfb2cdc (diff) | |
| parent | ee469058e1676bcf5d36c8754aa48f83733f9bdb (diff) | |
Rollup merge of #34190 - ollie27:wrapping_fmt, r=alexcrichton
Implement Binary, Octal, LowerHex and UpperHex for Wrapping<T> Fixes: #33659
| -rw-r--r-- | src/libcore/num/mod.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 883e9206dde..06398fc094e 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -66,6 +66,34 @@ impl<T: fmt::Display> fmt::Display for Wrapping<T> { } } +#[stable(feature = "wrapping_fmt", since = "1.11.0")] +impl<T: fmt::Binary> fmt::Binary for Wrapping<T> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.fmt(f) + } +} + +#[stable(feature = "wrapping_fmt", since = "1.11.0")] +impl<T: fmt::Octal> fmt::Octal for Wrapping<T> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.fmt(f) + } +} + +#[stable(feature = "wrapping_fmt", since = "1.11.0")] +impl<T: fmt::LowerHex> fmt::LowerHex for Wrapping<T> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.fmt(f) + } +} + +#[stable(feature = "wrapping_fmt", since = "1.11.0")] +impl<T: fmt::UpperHex> fmt::UpperHex for Wrapping<T> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.fmt(f) + } +} + mod wrapping; // All these modules are technically private and only exposed for libcoretest: |
