pub struct FunctionType {
pub ret: TypeId,
pub params: Vec<TypeId>,
pub variadic: bool,
pub prototyped: bool,
}Expand description
A function type.
Fields§
§ret: TypeIdWhat it returns.
params: Vec<TypeId>The parameter types, after the adjustments a parameter declaration gets: an array parameter has already decayed to a pointer and a function parameter to a function pointer, because those adjustments are part of forming the type and not part of calling it.
variadic: boolWhether the list ends in ....
prototyped: boolWhether there was a prototype at all.
int f() declares an unprototyped function before C23 and a function taking no
arguments from C23 onwards, and the difference is visible in what calls are checked
and in what the composite type of a redeclaration is. The dialect decides which
meaning () gets, and this records the decision rather than repeating it.
Trait Implementations§
Source§impl Clone for FunctionType
impl Clone for FunctionType
Source§fn clone(&self) -> FunctionType
fn clone(&self) -> FunctionType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FunctionType
impl Debug for FunctionType
impl Eq for FunctionType
Source§impl Hash for FunctionType
impl Hash for FunctionType
Source§impl PartialEq for FunctionType
impl PartialEq for FunctionType
impl StructuralPartialEq for FunctionType
Auto Trait Implementations§
impl Freeze for FunctionType
impl RefUnwindSafe for FunctionType
impl Send for FunctionType
impl Sync for FunctionType
impl Unpin for FunctionType
impl UnsafeUnpin for FunctionType
impl UnwindSafe for FunctionType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more