about summary refs log tree commit diff
path: root/tests/ui/allocator/allocator-args.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/allocator/allocator-args.rs')
-rw-r--r--tests/ui/allocator/allocator-args.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/allocator/allocator-args.rs b/tests/ui/allocator/allocator-args.rs
new file mode 100644
index 00000000000..1033f947c5f
--- /dev/null
+++ b/tests/ui/allocator/allocator-args.rs
@@ -0,0 +1,13 @@
+use std::alloc::{GlobalAlloc, Layout};
+
+struct A;
+
+unsafe impl GlobalAlloc for A {
+    unsafe fn alloc(&self, _: Layout) -> *mut u8 { panic!() }
+    unsafe fn dealloc(&self, _: *mut u8, _: Layout) { panic!() }
+}
+
+#[global_allocator(malloc)] //~ ERROR malformed `global_allocator` attribute input
+static S: A = A;
+
+fn main() {}