]> git.lizzy.rs Git - rust.git/blob - src/librustc_allocator/lib.rs
Rollup merge of #58353 - matthewjasper:typeck-pattern-constants, r=arielb1
[rust.git] / src / librustc_allocator / lib.rs
1 #![feature(nll)]
2 #![feature(rustc_private)]
3
4 #![deny(rust_2018_idioms)]
5
6 pub mod expand;
7
8 pub static ALLOCATOR_METHODS: &[AllocatorMethod] = &[
9     AllocatorMethod {
10         name: "alloc",
11         inputs: &[AllocatorTy::Layout],
12         output: AllocatorTy::ResultPtr,
13     },
14     AllocatorMethod {
15         name: "dealloc",
16         inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout],
17         output: AllocatorTy::Unit,
18     },
19     AllocatorMethod {
20         name: "realloc",
21         inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout, AllocatorTy::Usize],
22         output: AllocatorTy::ResultPtr,
23     },
24     AllocatorMethod {
25         name: "alloc_zeroed",
26         inputs: &[AllocatorTy::Layout],
27         output: AllocatorTy::ResultPtr,
28     },
29 ];
30
31 pub struct AllocatorMethod {
32     pub name: &'static str,
33     pub inputs: &'static [AllocatorTy],
34     pub output: AllocatorTy,
35 }
36
37 pub enum AllocatorTy {
38     Layout,
39     Ptr,
40     ResultPtr,
41     Unit,
42     Usize,
43 }