diff options
| author | Simon Sapin <simon.sapin@exyr.org> | 2018-03-23 13:42:43 +0100 |
|---|---|---|
| committer | Simon Sapin <simon.sapin@exyr.org> | 2018-03-26 23:34:22 +0200 |
| commit | 9fd399feb149bb7b58f21c54fc8c9358fea487a2 (patch) | |
| tree | 45a5d5c013dcdefbabc22b85f8889997862e41f2 /src | |
| parent | 2178ef8b220daec3228f6f4dae60787e506fa089 (diff) | |
| download | rust-9fd399feb149bb7b58f21c54fc8c9358fea487a2.tar.gz rust-9fd399feb149bb7b58f21c54fc8c9358fea487a2.zip | |
Don’t use `type Error = !` for target-dependant TryFrom impls.
Instead, expose apparently-fallible conversions in cases where the implementation happens to be infallible for a given target. Having an associated type / return type in a public API change based on the target is a portability hazard.
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/num/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index fa535e0e628..2da5718a358 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -3681,7 +3681,7 @@ macro_rules! try_from_unbounded { ($source:ty, $($target:ty),*) => {$( #[unstable(feature = "try_from", issue = "33417")] impl TryFrom<$source> for $target { - type Error = !; + type Error = TryFromIntError; #[inline] fn try_from(value: $source) -> Result<Self, Self::Error> { |
