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
2 changes: 1 addition & 1 deletion library/alloc/src/raw_vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ impl<T, A: Allocator> RawVec<T, A> {
}

#[inline]
pub(crate) fn non_null(&self) -> NonNull<T> {
pub(crate) const fn non_null(&self) -> NonNull<T> {
self.inner.non_null()
}

Expand Down
6 changes: 3 additions & 3 deletions library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1816,10 +1816,10 @@ impl<T, A: Allocator> Vec<T, A> {
/// [`as_ptr`]: Vec::as_ptr
/// [`as_non_null`]: Vec::as_non_null
#[unstable(feature = "box_vec_non_null", reason = "new API", issue = "130364")]
#[rustc_const_unstable(feature = "box_vec_non_null", reason = "new API", issue = "130364")]
#[inline]
pub fn as_non_null(&mut self) -> NonNull<T> {
// SAFETY: A `Vec` always has a non-null pointer.
unsafe { NonNull::new_unchecked(self.as_mut_ptr()) }
pub const fn as_non_null(&mut self) -> NonNull<T> {
self.buf.non_null()
}

/// Returns a reference to the underlying allocator.
Expand Down
Loading