Rollup merge of #81730 - RustyYato:object-safe-allocator, r=Amanieu
Make `Allocator` object-safe This allows rust-lang/wg-allocators#83: polymorphic allocators
This commit is contained in:
commit
ff3c85fd65
2 changed files with 17 additions and 1 deletions
|
|
@ -342,7 +342,10 @@ pub unsafe trait Allocator {
|
|||
///
|
||||
/// The returned adaptor also implements `Allocator` and will simply borrow this.
|
||||
#[inline(always)]
|
||||
fn by_ref(&self) -> &Self {
|
||||
fn by_ref(&self) -> &Self
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
self
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue