summary refs log tree commit diff
path: root/tests/ui/allocator/object-safe.rs
blob: 1c1f4fe0bf6ceb3dca6bf916d37b88eba56eac1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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);
}