about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcore/convert.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs
index 2d4813718f4..18ead0877fe 100644
--- a/src/libcore/convert.rs
+++ b/src/libcore/convert.rs
@@ -476,11 +476,11 @@ impl<T, U> TryInto<U> for T where U: TryFrom<T>
 // Infallible conversions are semantically equivalent to fallible conversions
 // with an uninhabited error type.
 #[unstable(feature = "try_from", issue = "33417")]
-impl<T, U> TryFrom<U> for T where T: From<U> {
+impl<T, U> TryFrom<U> for T where U: Into<T> {
     type Error = !;
 
     fn try_from(value: U) -> Result<Self, Self::Error> {
-        Ok(T::from(value))
+        Ok(U::into(value))
     }
 }