diff options
| author | Andrew Cann <shum@canndrew.org> | 2018-03-15 12:35:56 +0800 |
|---|---|---|
| committer | Andrew Cann <shum@canndrew.org> | 2018-03-15 12:35:56 +0800 |
| commit | 4647156985404f07dc2e61eed6f2e24770b339a9 (patch) | |
| tree | f9b49b7440b8f7300f694efbcc67965c315f9901 /src/libcore/num | |
| parent | a8a0c691914b72d1ca54057914b4cee2bd097ae3 (diff) | |
| download | rust-4647156985404f07dc2e61eed6f2e24770b339a9.tar.gz rust-4647156985404f07dc2e61eed6f2e24770b339a9.zip | |
replace `convert::Infallible` with `!`
Diffstat (limited to 'src/libcore/num')
| -rw-r--r-- | src/libcore/num/mod.rs | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 09ab7060d37..faeb87cf944 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::{Infallible, TryFrom}; +use convert::TryFrom; use fmt; use intrinsics; use ops; @@ -3595,20 +3595,12 @@ impl fmt::Display for TryFromIntError { } } -#[unstable(feature = "try_from", issue = "33417")] -impl From<Infallible> for TryFromIntError { - fn from(infallible: Infallible) -> TryFromIntError { - match infallible { - } - } -} - // no possible bounds violation macro_rules! try_from_unbounded { ($source:ty, $($target:ty),*) => {$( #[unstable(feature = "try_from", issue = "33417")] impl TryFrom<$source> for $target { - type Error = Infallible; + type Error = !; #[inline] fn try_from(value: $source) -> Result<Self, Self::Error> { @@ -3719,7 +3711,7 @@ try_from_lower_bounded!(isize, usize); #[cfg(target_pointer_width = "16")] mod ptr_try_from_impls { use super::TryFromIntError; - use convert::{Infallible, TryFrom}; + use convert::TryFrom; try_from_upper_bounded!(usize, u8); try_from_unbounded!(usize, u16, u32, u64, u128); @@ -3745,7 +3737,7 @@ mod ptr_try_from_impls { #[cfg(target_pointer_width = "32")] mod ptr_try_from_impls { use super::TryFromIntError; - use convert::{Infallible, TryFrom}; + use convert::TryFrom; try_from_upper_bounded!(usize, u8, u16); try_from_unbounded!(usize, u32, u64, u128); @@ -3771,7 +3763,7 @@ mod ptr_try_from_impls { #[cfg(target_pointer_width = "64")] mod ptr_try_from_impls { use super::TryFromIntError; - use convert::{Infallible, TryFrom}; + use convert::TryFrom; try_from_upper_bounded!(usize, u8, u16, u32); try_from_unbounded!(usize, u64, u128); |
