summaryrefslogtreecommitdiffstats
path: root/src/test/ui/allocator/allocator-args.rs
blob: 1033f947c5f5b68a72f4b4bde656114a7c9ad63b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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() {}