rust/src/test/ui/allocator/object-safe.rs
RustyYato d06384ac29
make Allocator object-safe
add test to ensure object-safety
This allows for runtime polymorphic allocators
2021-02-03 20:46:16 -05:00

13 lines
253 B
Rust

// 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);
}