diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs index 2d4813718f41..18ead0877fe8 100644 --- a/src/libcore/convert.rs +++ b/src/libcore/convert.rs @@ -476,11 +476,11 @@ impl TryInto for T where U: TryFrom // Infallible conversions are semantically equivalent to fallible conversions // with an uninhabited error type. #[unstable(feature = "try_from", issue = "33417")] -impl TryFrom for T where T: From { +impl TryFrom for T where U: Into { type Error = !; fn try_from(value: U) -> Result { - Ok(T::from(value)) + Ok(U::into(value)) } }