]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Unit structs are not concrete when they need substitutions
authorPhilip Herron <philip.herron@embecosm.com>
Wed, 31 Aug 2022 16:16:13 +0000 (17:16 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 31 Jan 2023 13:16:50 +0000 (14:16 +0100)
Fixes #1518

gcc/rust/ChangeLog:

* typecheck/rust-tyty.h: Fix `is_concrete` for unit types with
substitutions.

gcc/rust/typecheck/rust-tyty.h

index 24efc7aa54c3eb4890cb98c0928b653078dd7077..43460d2dd2f3e93a57e068a36bad8a4595ac1cbb 100644 (file)
@@ -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 ())