diff options
| author | Ohad Ravid <ohad.rv@gmail.com> | 2019-10-29 19:12:37 +0100 |
|---|---|---|
| committer | Ohad Ravid <ohad.rv@gmail.com> | 2019-10-31 17:11:22 +0100 |
| commit | 3b7c0d3fa0fcb437c3b7de9674429fe77f62c927 (patch) | |
| tree | f7835bb5c32265347c13a5590c5cb4368c9a7e8e | |
| parent | 026aee62ac04ae79059c902867bbf523afaa3583 (diff) | |
| download | rust-3b7c0d3fa0fcb437c3b7de9674429fe77f62c927.tar.gz rust-3b7c0d3fa0fcb437c3b7de9674429fe77f62c927.zip | |
Change `Into` docs to refer only to older versions of rust
| -rw-r--r-- | src/libcore/convert.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs index 3cd2337ee59..9e1501649a2 100644 --- a/src/libcore/convert.rs +++ b/src/libcore/convert.rs @@ -220,11 +220,11 @@ pub trait AsMut<T: ?Sized> { /// /// # Implementing [`Into`] for conversions to external types /// -/// If the destination type is not part of the current crate -/// then you can't implement [`From`] directly. +/// Prior to Rust 1.40, if the destination type was not part of the current crate +/// then you couldn't implement [`From`] directly. /// For example, take this code: /// -/// ```compile_fail +/// ``` /// struct Wrapper<T>(Vec<T>); /// impl<T> From<Wrapper<T>> for Vec<T> { /// fn from(w: Wrapper<T>) -> Vec<T> { @@ -232,9 +232,8 @@ pub trait AsMut<T: ?Sized> { /// } /// } /// ``` -/// This will fail to compile because we cannot implement a trait for a type -/// if both the trait and the type are not defined by the current crate. -/// This is due to Rust's orphaning rules. To bypass this, you can implement [`Into`] directly: +/// This will fail to compile in older versions of the language because Rust's orphaning rules +/// used to be a little bit more strict. To bypass this, you could implement [`Into`] directly: /// /// ``` /// struct Wrapper<T>(Vec<T>); |
