summaryrefslogtreecommitdiffstats
path: root/tests/ui/allocator/object-safe.rs
blob: fae7ab7fe331969f16637fa25ab3878db28729e1 (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);
}