Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

References refer to allocated objects #116677

Merged
merged 7 commits into from
Jan 29, 2024
Merged
Changes from 2 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
11 changes: 11 additions & 0 deletions library/core/src/primitive_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,17 @@ mod prim_usize {}
/// work on references as well as they do on owned values! The implementations described here are
/// meant for generic contexts, where the final type `T` is a type parameter or otherwise not
/// locally known.
///
/// # Safety
///
/// For all types, `T: ?Sized`, and for all `t: &T` or `t: &mut T`, unsafe code may assume that
/// the following properties hold. It is undefined behavior to produce a `t: &T` or `t: &mut T`
/// which violates any of these properties.
///
/// * `t` is aligned to `align_of_val(t)`
/// * `t` refers to a single [allocated object]
joshlf marked this conversation as resolved.
Show resolved Hide resolved
///
/// [allocated object]: ptr#allocated-object
#[stable(feature = "rust1", since = "1.0.0")]
mod prim_ref {}

Expand Down
Loading