mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 20:46:07 +03:00
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:
@@ -0,0 +1,13 @@
|
||||
// run-pass
|
||||
|
||||
// Check that `Allocator` is object safe, this allows for polymorphic allocators
|
||||
|
||||
#![feature(allocator_api)]
|
||||
|
||||
use std::alloc::{Allocator, System};
|
||||
|
||||
fn ensure_object_safe(_: &dyn Allocator) {}
|
||||
|
||||
fn main() {
|
||||
ensure_object_safe(&System);
|
||||
}
|
||||
Reference in New Issue
Block a user