about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-01-21 08:32:19 +0000
committerbors <bors@rust-lang.org>2019-01-21 08:32:19 +0000
commit33b0b7148fa4eacf43c204b2505867a4cd8e4735 (patch)
tree5fbc9f7aa1ea1c430548853e5c3bf13f643b9a25 /src/libcore
parentb5f5a2715ed8685bc19fd589a23c7c658c2fe6bd (diff)
parent00c60d115cfb979c4ca39bb1ce3afc7bf0548d79 (diff)
downloadrust-33b0b7148fa4eacf43c204b2505867a4cd8e4735.tar.gz
rust-33b0b7148fa4eacf43c204b2505867a4cd8e4735.zip
Auto merge of #57792 - Centril:rollup, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #56796 (Change bounds on `TryFrom` blanket impl to use `Into` instead of `From`)
 - #57768 (Continue parsing after parent type args and suggest using angle brackets)
 - #57769 (Suggest correct cast for struct fields with shorthand syntax)
 - #57783 (Add "dereference boxed value" suggestion.)
 - #57784 (Add span for bad doc comment)

Failed merges:

r? @ghost
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 08b5ac06f72..203be541e49 100644
--- a/src/libcore/convert.rs
+++ b/src/libcore/convert.rs
@@ -463,11 +463,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))
     }
 }