File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -339,14 +339,16 @@ impl<H: Header> DynSizedStructure<H> {
339339 /// Performs a memory-safe same-size cast from the base-structure to a
340340 /// specific [`MaybeDynSized`]. The idea here is to cast the generic
341341 /// mostly semantic-free version to a specific type with fields that have
342- /// a semantic.
342+ /// a clear semantic.
343343 ///
344344 /// The provided `T` of type [`MaybeDynSized`] might be may be sized type
345- /// or DST. This depends on the type.
345+ /// or DST. This depends on the type. However, the source and the target
346+ /// both will have the same actual payload size and the same
347+ /// [`size_of_val`].
346348 ///
347349 /// # Panic
348350 /// Panics if base assumptions are violated. For example, the
349- /// `T` of type [`MaybeDynSized`] must allow a proper casting to it.
351+ /// `T` of type [`MaybeDynSized`] must allow proper same-size casting to it.
350352 ///
351353 /// # Safety
352354 /// This function is safe due to various sanity checks and the overall
@@ -355,6 +357,8 @@ impl<H: Header> DynSizedStructure<H> {
355357 /// # Panics
356358 /// This panics if there is a size mismatch. However, this should never be
357359 /// the case if all types follow their documented requirements.
360+ ///
361+ /// [`size_of_val`]: mem::size_of_val
358362 pub fn cast < T : MaybeDynSized < Header = H > + ?Sized > ( & self ) -> & T {
359363 let base_ptr = ptr:: addr_of!( * self ) ;
360364
You can’t perform that action at this time.
0 commit comments