Skip to content

Commit 72a81e5

Browse files
RustyYatoVardhan Thigle
authored andcommitted
Change bounds on TryFrom blanket impl to use Into instead of From
1 parent e041159 commit 72a81e5

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
@@ -463,11 +463,11 @@ impl<T, U> TryInto<U> for T where U: TryFrom<T>
463463
// Infallible conversions are semantically equivalent to fallible conversions
464464
// with an uninhabited error type.
465465
#[unstable(feature = "try_from", issue = "33417")]
466-
impl<T, U> TryFrom<U> for T where T: From<U> {
466+
impl<T, U> TryFrom<U> for T where U: Into<T> {
467467
type Error = !;
468468

469469
fn try_from(value: U) -> Result<Self, Self::Error> {
470-
Ok(T::from(value))
470+
Ok(U::into(value))
471471
}
472472
}
473473

0 commit comments

Comments
 (0)