about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2021-02-05 12:26:05 +0100
committerGitHub <noreply@github.com>2021-02-05 12:26:05 +0100
commitff3c85fd65fa875d2fa4bfdd790cf8dcfaba6ba3 (patch)
treecbb5476e3ab1951245e5e103265c64621a4158d9 /src
parent21c276f9c87daa5fc5ff34e81fd1f1d5112afe00 (diff)
parentd06384ac29098c3a4b3e21eb2f70093e800bd1b6 (diff)
downloadrust-ff3c85fd65fa875d2fa4bfdd790cf8dcfaba6ba3.tar.gz
rust-ff3c85fd65fa875d2fa4bfdd790cf8dcfaba6ba3.zip
Rollup merge of #81730 - RustyYato:object-safe-allocator, r=Amanieu
Make `Allocator` object-safe

This allows rust-lang/wg-allocators#83: polymorphic allocators
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/allocator/object-safe.rs13
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 00000000000..fae7ab7fe33
--- /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);
+}