diff options
| author | Jimmy Cuadra <jimmy@jimmycuadra.com> | 2017-09-01 01:57:05 -0700 |
|---|---|---|
| committer | Jimmy Cuadra <jimmy@jimmycuadra.com> | 2017-09-01 01:57:05 -0700 |
| commit | 93a56cdacd29e8b29bae45c3abca229f6011a492 (patch) | |
| tree | 5c6e6a2723b48c86d647191695433a1b12ac856b /src/libcore/num | |
| parent | 36c0ff8690621f44b7bed31da96fbc64a101c2af (diff) | |
| download | rust-93a56cdacd29e8b29bae45c3abca229f6011a492.tar.gz rust-93a56cdacd29e8b29bae45c3abca229f6011a492.zip | |
impl From<Infallible> for TryFromIntError.
Diffstat (limited to 'src/libcore/num')
| -rw-r--r-- | src/libcore/num/mod.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 4372646a569..9f87e2bd831 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -12,7 +12,7 @@ #![stable(feature = "rust1", since = "1.0.0")] -use convert::TryFrom; +use convert::{Infallible, TryFrom}; use fmt; use intrinsics; use str::FromStr; @@ -2503,6 +2503,13 @@ impl fmt::Display for TryFromIntError { } } +#[unstable(feature = "try_from", issue = "33417")] +impl From<Infallible> for TryFromIntError { + fn from(_: Infallible) -> TryFromIntError { + TryFromIntError(()) + } +} + // no possible bounds violation macro_rules! try_from_unbounded { ($source:ty, $($target:ty),*) => {$( |
