diff options
Diffstat (limited to 'tests/ui/allocator/object-safe.rs')
-rw-r--r-- | tests/ui/allocator/object-safe.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/allocator/object-safe.rs b/tests/ui/allocator/object-safe.rs new file mode 100644 index 000000000..fae7ab7fe --- /dev/null +++ b/tests/ui/allocator/object-safe.rs @@ -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); +} |