@@ -1181,12 +1181,19 @@ impl<T: ?Sized> Rc<T> {
1181
1181
/// Constructs an `Rc<T>` from a raw pointer.
1182
1182
///
1183
1183
/// The raw pointer must have been previously returned by a call to
1184
- /// [`Rc<U>::into_raw`][into_raw] where `U` must have the same size
1185
- /// and alignment as `T`. This is trivially true if `U` is `T`.
1186
- /// Note that if `U` is not `T` but has the same size and alignment, this is
1187
- /// basically like transmuting references of different types. See
1188
- /// [`mem::transmute`][transmute] for more information on what
1189
- /// restrictions apply in this case.
1184
+ /// [`Rc<U>::into_raw`][into_raw] with the following requirements:
1185
+ ///
1186
+ /// * If `U` is sized, it must have the same size and alignment as `T`. This
1187
+ /// is trivially true if `U` is `T`.
1188
+ /// * If `U` is unsized, its data pointer must have the same size and
1189
+ /// alignment as `T`. This is trivially true if `Arc<U>` was constructed
1190
+ /// through `Arc<T>` and then converted to `Arc<U>` through an [unsized
1191
+ /// coercion].
1192
+ ///
1193
+ /// Note that if `U` or `U`'s data pointer is not `T` but has the same size
1194
+ /// and alignment, this is basically like transmuting references of
1195
+ /// different types. See [`mem::transmute`][transmute] for more information
1196
+ /// on what restrictions apply in this case.
1190
1197
///
1191
1198
/// The raw pointer must point to a block of memory allocated by the global allocator
1192
1199
///
@@ -1198,6 +1205,7 @@ impl<T: ?Sized> Rc<T> {
1198
1205
///
1199
1206
/// [into_raw]: Rc::into_raw
1200
1207
/// [transmute]: core::mem::transmute
1208
+ /// [unsized coercion]: https://doc.rust-lang.org/reference/type-coercions.html#unsized-coercions
1201
1209
///
1202
1210
/// # Examples
1203
1211
///
0 commit comments