diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-06-25 12:23:49 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-06-25 12:23:49 +0100 |
commit | 3ede4ff311bed634753293858b2547e13a84f4bf (patch) | |
tree | f0e5eaafcbe4954397cc0778b9d7301bca14c041 /gcc | |
parent | 13fd4d31da76676e7de4ee4978093353f8d0fbc5 (diff) | |
download | gcc-3ede4ff311bed634753293858b2547e13a84f4bf.zip gcc-3ede4ff311bed634753293858b2547e13a84f4bf.tar.gz gcc-3ede4ff311bed634753293858b2547e13a84f4bf.tar.bz2 |
ADT types can be empty signifying a unit-struct
struct S; Turns into an ADT type which is a type of unit-struct.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/typecheck/rust-tyty.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h index ac87960..51ede17 100644 --- a/gcc/rust/typecheck/rust-tyty.h +++ b/gcc/rust/typecheck/rust-tyty.h @@ -843,6 +843,8 @@ public: bool get_is_tuple () { return is_tuple; } + bool is_unit () const override { return this->fields.empty (); } + void accept_vis (TyVisitor &vis) override; std::string as_string () const override; |