File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -220,21 +220,20 @@ pub trait AsMut<T: ?Sized> {
220
220
///
221
221
/// # Implementing [`Into`] for conversions to external types
222
222
///
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.
225
225
/// For example, take this code:
226
226
///
227
- /// ```compile_fail
227
+ /// ```
228
228
/// struct Wrapper<T>(Vec<T>);
229
229
/// impl<T> From<Wrapper<T>> for Vec<T> {
230
230
/// fn from(w: Wrapper<T>) -> Vec<T> {
231
231
/// w.0
232
232
/// }
233
233
/// }
234
234
/// ```
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:
238
237
///
239
238
/// ```
240
239
/// struct Wrapper<T>(Vec<T>);
You can’t perform that action at this time.
0 commit comments