diff options
author | Philip Herron <philip.herron@embecosm.com> | 2022-08-31 17:16:13 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2022-08-31 17:17:04 +0100 |
commit | 63403f0af7203f3b3c4bc2fef52fee884bb728b8 (patch) | |
tree | 69e9a51279bce8099b757e17670af963193cf754 /gcc | |
parent | 126c7c9d7a2f9023115d6c692dbcf9e981ba2b4a (diff) | |
download | gcc-63403f0af7203f3b3c4bc2fef52fee884bb728b8.zip gcc-63403f0af7203f3b3c4bc2fef52fee884bb728b8.tar.gz gcc-63403f0af7203f3b3c4bc2fef52fee884bb728b8.tar.bz2 |
Unit structs are not concrete when they need substitutions
Fixes #1518
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/typecheck/rust-tyty.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h index 649f133..74c8c35 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 ()) |