Skip to content

Commit f8bd80a

Browse files
committed
Change bounds on TryFrom blanket impl to use Into instead of From
1 parent f4a421e commit f8bd80a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/convert.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,11 @@ impl<T, U> TryInto<U> for T where U: TryFrom<T>
476476
// Infallible conversions are semantically equivalent to fallible conversions
477477
// with an uninhabited error type.
478478
#[unstable(feature = "try_from", issue = "33417")]
479-
impl<T, U> TryFrom<U> for T where T: From<U> {
479+
impl<T, U> TryFrom<U> for T where U: Into<T> {
480480
type Error = !;
481481

482482
fn try_from(value: U) -> Result<Self, Self::Error> {
483-
Ok(T::from(value))
483+
Ok(U::into(value))
484484
}
485485
}
486486

0 commit comments

Comments
 (0)