about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorOzaren <krishna.sd.2012@gmail.com>2018-12-13 16:53:50 -0500
committerOzaren <krishna.sd.2012@gmail.com>2018-12-13 16:53:50 -0500
commitf8bd80a830509d4356b76bc44a50c798db1bb3ea (patch)
treec832257eac4fc30e50c11ec217e1a973fc683a59 /src/libcore
parentf4a421ee3cf1259f0750ac7fabd19da1d8551e4c (diff)
downloadrust-f8bd80a830509d4356b76bc44a50c798db1bb3ea.tar.gz
rust-f8bd80a830509d4356b76bc44a50c798db1bb3ea.zip
Change bounds on `TryFrom` blanket impl to use `Into` instead of `From`
Diffstat (limited to 'src/libcore')
-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))
     }
 }