aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-tyty.h
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-03-04 13:46:30 +0000
committerPhilip Herron <philip.herron@embecosm.com>2022-03-07 12:06:20 +0000
commitbe94ef6e2d7ce29896c3e2861a8506479dfd55b5 (patch)
tree5aa8c4d1d8f934ec7ecbd39e6d1443dbb0dfc741 /gcc/rust/backend/rust-compile-tyty.h
parent7a3c935c0f220835c001307944587a84c5af0192 (diff)
downloadgcc-be94ef6e2d7ce29896c3e2861a8506479dfd55b5.zip
gcc-be94ef6e2d7ce29896c3e2861a8506479dfd55b5.tar.gz
gcc-be94ef6e2d7ce29896c3e2861a8506479dfd55b5.tar.bz2
Change unit-type to be an empty struct so that we do not disregard the
initilizer of variables
Diffstat (limited to 'gcc/rust/backend/rust-compile-tyty.h')
-rw-r--r--gcc/rust/backend/rust-compile-tyty.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/rust/backend/rust-compile-tyty.h b/gcc/rust/backend/rust-compile-tyty.h
index a3720f8..52ad2f9 100644
--- a/gcc/rust/backend/rust-compile-tyty.h
+++ b/gcc/rust/backend/rust-compile-tyty.h
@@ -54,10 +54,10 @@ public:
void visit (TyTy::TupleType &type) override
{
- if (type.num_fields () == 0)
- translated = backend->unit_type ();
- else
- gcc_unreachable ();
+ // this interface is only for unit-type the -type interface takes into
+ // account the context
+ rust_assert (type.num_fields () == 0);
+ translated = backend->unit_type ();
}
void visit (TyTy::ArrayType &) override { gcc_unreachable (); }