Skip to content

Commit 3b7c0d3

Browse files
committed
Change Into docs to refer only to older versions of rust
1 parent 026aee6 commit 3b7c0d3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/libcore/convert.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -220,21 +220,20 @@ pub trait AsMut<T: ?Sized> {
220220
///
221221
/// # Implementing [`Into`] for conversions to external types
222222
///
223-
/// If the destination type is not part of the current crate
224-
/// then you can't implement [`From`] directly.
223+
/// Prior to Rust 1.40, if the destination type was not part of the current crate
224+
/// then you couldn't implement [`From`] directly.
225225
/// For example, take this code:
226226
///
227-
/// ```compile_fail
227+
/// ```
228228
/// struct Wrapper<T>(Vec<T>);
229229
/// impl<T> From<Wrapper<T>> for Vec<T> {
230230
/// fn from(w: Wrapper<T>) -> Vec<T> {
231231
/// w.0
232232
/// }
233233
/// }
234234
/// ```
235-
/// This will fail to compile because we cannot implement a trait for a type
236-
/// if both the trait and the type are not defined by the current crate.
237-
/// This is due to Rust's orphaning rules. To bypass this, you can implement [`Into`] directly:
235+
/// This will fail to compile in older versions of the language because Rust's orphaning rules
236+
/// used to be a little bit more strict. To bypass this, you could implement [`Into`] directly:
238237
///
239238
/// ```
240239
/// struct Wrapper<T>(Vec<T>);

0 commit comments

Comments
 (0)