Skip to content

Commit c0a8aae

Browse files
authored
Rollup merge of rust-lang#81730 - RustyYato:object-safe-allocator, r=Amanieu
Make `Allocator` object-safe This allows rust-lang/wg-allocators#83: polymorphic allocators
2 parents f893d98 + 36da299 commit c0a8aae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/src/alloc/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,10 @@ pub unsafe trait Allocator {
342342
///
343343
/// The returned adaptor also implements `Allocator` and will simply borrow this.
344344
#[inline(always)]
345-
fn by_ref(&self) -> &Self {
345+
fn by_ref(&self) -> &Self
346+
where
347+
Self: Sized,
348+
{
346349
self
347350
}
348351
}

0 commit comments

Comments
 (0)