Skip to content

Apply docs convention: Replace # Unsafety with # Safety in docs #58718

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

Merged
merged 1 commit into from
Feb 25, 2019
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: 2 additions & 2 deletions src/libcore/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ impl fmt::Display for CannotReallocInPlace {
/// }
/// ```
///
/// # Unsafety
/// # Safety
///
/// The `GlobalAlloc` trait is an `unsafe` trait for a number of reasons, and
/// implementors must ensure that they adhere to these contracts:
Expand Down Expand Up @@ -643,7 +643,7 @@ pub unsafe trait GlobalAlloc {
/// currently allocated via an allocator `a`, then it is legal to
/// use that layout to deallocate it, i.e., `a.dealloc(ptr, k);`.
///
/// # Unsafety
/// # Safety
///
/// The `Alloc` trait is an `unsafe` trait for a number of reasons, and
/// implementors must ensure that they adhere to these contracts:
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ impl<T> MaybeUninit<T> {
/// to ensure that the data will get dropped, because the resulting `T` is
/// subject to the usual drop handling.
///
/// # Unsafety
/// # Safety
///
/// It is up to the caller to guarantee that the `MaybeUninit` really is in an initialized
/// state. Calling this when the content is not yet fully initialized causes undefined
Expand All @@ -1187,7 +1187,7 @@ impl<T> MaybeUninit<T> {

/// Gets a reference to the contained value.
///
/// # Unsafety
/// # Safety
///
/// It is up to the caller to guarantee that the `MaybeUninit` really is in an initialized
/// state. Calling this when the content is not yet fully initialized causes undefined
Expand All @@ -1200,7 +1200,7 @@ impl<T> MaybeUninit<T> {

/// Gets a mutable reference to the contained value.
///
/// # Unsafety
/// # Safety
///
/// It is up to the caller to guarantee that the `MaybeUninit` really is in an initialized
/// state. Calling this when the content is not yet fully initialized causes undefined
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2158,7 +2158,7 @@ impl<T> [T] {
/// This method has no purpose when either input element `T` or output element `U` are
/// zero-sized and will return the original slice without splitting anything.
///
/// # Unsafety
/// # Safety
///
/// This method is essentially a `transmute` with respect to the elements in the returned
/// middle slice, so all the usual caveats pertaining to `transmute::<T, U>` also apply here.
Expand Down Expand Up @@ -2211,7 +2211,7 @@ impl<T> [T] {
/// This method has no purpose when either input element `T` or output element `U` are
/// zero-sized and will return the original slice without splitting anything.
///
/// # Unsafety
/// # Safety
///
/// This method is essentially a `transmute` with respect to the elements in the returned
/// middle slice, so all the usual caveats pertaining to `transmute::<T, U>` also apply here.
Expand Down