aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-08-31 17:16:13 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2023-01-31 14:16:50 +0100
commit0fffc0e772d612d5c6ad72a632ac80b43eca1950 (patch)
tree5688bd62b5eeeabb93f50abe329edce9cc8fb733 /gcc/rust
parente641158a5f5cd80ee2ce32fded1179ce1b3e1193 (diff)
downloadgcc-0fffc0e772d612d5c6ad72a632ac80b43eca1950.zip
gcc-0fffc0e772d612d5c6ad72a632ac80b43eca1950.tar.gz
gcc-0fffc0e772d612d5c6ad72a632ac80b43eca1950.tar.bz2
gccrs: Unit structs are not concrete when they need substitutions
Fixes #1518 gcc/rust/ChangeLog: * typecheck/rust-tyty.h: Fix `is_concrete` for unit types with substitutions.
Diffstat (limited to 'gcc/rust')
-rw-r--r--gcc/rust/typecheck/rust-tyty.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h
index 24efc7a..43460d2 100644
--- a/gcc/rust/typecheck/rust-tyty.h
+++ b/gcc/rust/typecheck/rust-tyty.h
@@ -1362,6 +1362,11 @@ public:
bool is_concrete () const override final
{
+ if (is_unit ())
+ {
+ return !needs_substitution ();
+ }
+
for (auto &variant : variants)
{
for (auto &field : variant->get_fields ())