Skip to content

Commit 9fd399f

Browse files
committed
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.
1 parent 2178ef8 commit 9fd399f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/libcore/num/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3681,7 +3681,7 @@ macro_rules! try_from_unbounded {
36813681
($source:ty, $($target:ty),*) => {$(
36823682
#[unstable(feature = "try_from", issue = "33417")]
36833683
impl TryFrom<$source> for $target {
3684-
type Error = !;
3684+
type Error = TryFromIntError;
36853685

36863686
#[inline]
36873687
fn try_from(value: $source) -> Result<Self, Self::Error> {

0 commit comments

Comments
 (0)