Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion library/core/src/alloc/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ impl Layout {
///
/// # Safety
///
/// This function is only safe to call if the following conditions hold:
/// This function is safe to call if the pointer is safe to reborrow as `&T`
/// (in which case you could also call [`for_value`][Self::for_value]).
/// Otherwise, the following conditions must hold:
///
/// - If `T` is `Sized`, this function is always safe to call.
/// - If the unsized tail of `T` is:
Expand Down
4 changes: 3 additions & 1 deletion library/core/src/mem/alignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ impl Alignment {
///
/// # Safety
///
/// This function is only safe to call if the following conditions hold:
/// This function is safe to call if the pointer is safe to reborrow as `&T`
/// (in which case you could also call [`of_val`][Self::of_val]).
/// Otherwise, the following conditions must hold:
///
/// - If `T` is `Sized`, this function is always safe to call.
/// - If the unsized tail of `T` is:
Expand Down
8 changes: 6 additions & 2 deletions library/core/src/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,9 @@ pub const fn size_of_val<T: ?Sized>(val: &T) -> usize {
///
/// # Safety
///
/// This function is only safe to call if the following conditions hold:
/// This function is safe to call if the pointer is safe to reborrow as `&T`
/// (in which case you could also call [`size_of_val`]).
/// Otherwise, the following conditions must hold:
///
/// - If `T` is `Sized`, this function is always safe to call.
/// - If the unsized tail of `T` is:
Expand Down Expand Up @@ -592,7 +594,9 @@ pub const fn align_of_val<T: ?Sized>(val: &T) -> usize {
///
/// # Safety
///
/// This function is only safe to call if the following conditions hold:
/// This function is safe to call if the pointer is safe to reborrow as `&T`
/// (in which case you could also call [`align_of_val`]).
/// Otherwise, the following conditions must hold:
///
/// - If `T` is `Sized`, this function is always safe to call.
/// - If the unsized tail of `T` is:
Expand Down
Loading