diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:59:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:59:35 +0000 |
commit | d1b2d29528b7794b41e66fc2136e395a02f8529b (patch) | |
tree | a4a17504b260206dec3cf55b2dca82929a348ac2 /compiler/rustc_ast/src/expand | |
parent | Releasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip |
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_ast/src/expand')
-rw-r--r-- | compiler/rustc_ast/src/expand/allocator.rs | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/compiler/rustc_ast/src/expand/allocator.rs b/compiler/rustc_ast/src/expand/allocator.rs index e87f6e820..f825b10f4 100644 --- a/compiler/rustc_ast/src/expand/allocator.rs +++ b/compiler/rustc_ast/src/expand/allocator.rs @@ -33,29 +33,41 @@ pub enum AllocatorTy { pub struct AllocatorMethod { pub name: Symbol, - pub inputs: &'static [AllocatorTy], + pub inputs: &'static [AllocatorMethodInput], pub output: AllocatorTy, } +pub struct AllocatorMethodInput { + pub name: &'static str, + pub ty: AllocatorTy, +} + pub static ALLOCATOR_METHODS: &[AllocatorMethod] = &[ AllocatorMethod { name: sym::alloc, - inputs: &[AllocatorTy::Layout], + inputs: &[AllocatorMethodInput { name: "layout", ty: AllocatorTy::Layout }], output: AllocatorTy::ResultPtr, }, AllocatorMethod { name: sym::dealloc, - inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout], + inputs: &[ + AllocatorMethodInput { name: "ptr", ty: AllocatorTy::Ptr }, + AllocatorMethodInput { name: "layout", ty: AllocatorTy::Layout }, + ], output: AllocatorTy::Unit, }, AllocatorMethod { name: sym::realloc, - inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout, AllocatorTy::Usize], + inputs: &[ + AllocatorMethodInput { name: "ptr", ty: AllocatorTy::Ptr }, + AllocatorMethodInput { name: "layout", ty: AllocatorTy::Layout }, + AllocatorMethodInput { name: "new_size", ty: AllocatorTy::Usize }, + ], output: AllocatorTy::ResultPtr, }, AllocatorMethod { name: sym::alloc_zeroed, - inputs: &[AllocatorTy::Layout], + inputs: &[AllocatorMethodInput { name: "layout", ty: AllocatorTy::Layout }], output: AllocatorTy::ResultPtr, }, ]; |