1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
13 #![feature(rustc_private)]
16 extern crate rustc_errors;
18 extern crate syntax_pos;
22 pub static ALLOCATOR_METHODS: &[AllocatorMethod] = &[
25 inputs: &[AllocatorTy::Layout],
26 output: AllocatorTy::ResultPtr,
30 inputs: &[AllocatorTy::AllocErr],
31 output: AllocatorTy::Bang,
35 inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout],
36 output: AllocatorTy::Unit,
40 inputs: &[AllocatorTy::LayoutRef],
41 output: AllocatorTy::UsizePair,
45 inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout, AllocatorTy::Layout],
46 output: AllocatorTy::ResultPtr,
50 inputs: &[AllocatorTy::Layout],
51 output: AllocatorTy::ResultPtr,
55 inputs: &[AllocatorTy::Layout],
56 output: AllocatorTy::ResultExcess,
59 name: "realloc_excess",
60 inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout, AllocatorTy::Layout],
61 output: AllocatorTy::ResultExcess,
64 name: "grow_in_place",
65 inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout, AllocatorTy::Layout],
66 output: AllocatorTy::ResultUnit,
69 name: "shrink_in_place",
70 inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout, AllocatorTy::Layout],
71 output: AllocatorTy::ResultUnit,
75 pub struct AllocatorMethod {
76 pub name: &'static str,
77 pub inputs: &'static [AllocatorTy],
78 pub output: AllocatorTy,
81 pub enum AllocatorTy {