Skip to content

Commit

Permalink
Rename Box::alloc to Box::alloc_ref
Browse files Browse the repository at this point in the history
  • Loading branch information
TimDiekmann committed Oct 23, 2020
1 parent 955b37b commit 693a2bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/alloc/src/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -738,11 +738,11 @@ impl<T: ?Sized, A: AllocRef> Box<T, A> {
/// Returns a reference to the underlying allocator.
///
/// Note: this is an associated function, which means that you have
/// to call it as `Box::alloc(&b)` instead of `b.alloc()`. This
/// to call it as `Box::alloc_ref(&b)` instead of `b.alloc_ref()`. This
/// is so that there is no conflict with a method on the inner type.
#[unstable(feature = "allocator_api", issue = "32838")]
#[inline]
pub fn alloc(b: &Self) -> &A {
pub fn alloc_ref(b: &Self) -> &A {
&b.1
}

Expand Down

0 comments on commit 693a2bf

Please sign in to comment.