diff options
author | Griffin Smith <grfn@gws.fyi> | 2021-03-28T17·28-0400 |
---|---|---|
committer | glittershark <grfn@gws.fyi> | 2021-03-28T17·33+0000 |
commit | 8e13b1303a0d152c2f3b68f2421163e94fdf226c (patch) | |
tree | 0cac0fee2cd52f912bb118cff78fdca9d28ac895 /users/glittershark/achilles/src/ast/hir.rs | |
parent | db62866d820cf524b67cebe34033d3928804cf3c (diff) |
feat(achilles): Implement a Unit type r/2356
Add support for a zero-sized Unit type. This requires some special at the codegen level because LLVM (unsurprisingly) only allows Void types in function return position - to make that a little easier to handle there's a new pass that strips any unit-only expressions and pulls unit-only function arguments up to new `let` bindings, so we never have to actually pass around unit values. Change-Id: I0fc18a516821f2d69172c42a6a5d246b23471e38 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2695 Reviewed-by: glittershark <grfn@gws.fyi> Tested-by: BuildkiteCI
Diffstat (limited to 'users/glittershark/achilles/src/ast/hir.rs')
-rw-r--r-- | users/glittershark/achilles/src/ast/hir.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/users/glittershark/achilles/src/ast/hir.rs b/users/glittershark/achilles/src/ast/hir.rs index 8726af509388..0d145d620bef 100644 --- a/users/glittershark/achilles/src/ast/hir.rs +++ b/users/glittershark/achilles/src/ast/hir.rs @@ -246,7 +246,7 @@ impl<'a, T> Expr<'a, T> { } } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum Decl<'a, T> { Fun { name: Ident<'a>, |