diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-10-13 04:58:45 +0200 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-11-21 14:55:33 +0100 |
| commit | 089229a1935fa9795cfdefa518c8f8c3beb66db8 (patch) | |
| tree | af47f9f8319b41321436ee6d1a6a73b2f7f3e0bd /src/libcore/num | |
| parent | 6eb0627b49edb03d27722cab4d13f92a9a65a1c8 (diff) | |
| download | rust-089229a1935fa9795cfdefa518c8f8c3beb66db8.tar.gz rust-089229a1935fa9795cfdefa518c8f8c3beb66db8.zip | |
Redefine `core::convert::Infallible` as `!`.
Diffstat (limited to 'src/libcore/num')
| -rw-r--r-- | src/libcore/num/mod.rs | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index c2f85b9535e..4313248f263 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -4,7 +4,7 @@ #![stable(feature = "rust1", since = "1.0.0")] -use crate::convert::{TryFrom, Infallible}; +use crate::convert::TryFrom; use crate::fmt; use crate::intrinsics; use crate::mem; @@ -4722,18 +4722,8 @@ impl fmt::Display for TryFromIntError { } #[stable(feature = "try_from", since = "1.34.0")] -impl From<Infallible> for TryFromIntError { - fn from(x: Infallible) -> TryFromIntError { - match x {} - } -} - -#[stable(feature = "never_type", since = "1.41.0")] impl From<!> for TryFromIntError { fn from(never: !) -> TryFromIntError { - // Match rather than coerce to make sure that code like - // `From<Infallible> for TryFromIntError` above will keep working - // when `Infallible` becomes an alias to `!`. match never {} } } |
