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