]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Revert "gccrs: Remove the template parameter
authorPhilip Herron <herron.philip@googlemail.com>
Wed, 3 Sep 2025 15:55:46 +0000 (16:55 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Fri, 27 Feb 2026 14:57:04 +0000 (15:57 +0100)
This reverts commit a50fb38f36506e02139f3ff9343e099c2f5508d7 as it breaks
gcc5 bootstrap.

gcc/rust/ChangeLog:

* typecheck/rust-tyty.cc (VariantDef::clone): revert
(VariantDef::monomorphized_clone): likewise

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/typecheck/rust-tyty.cc

index c2e1bf438f7b135e5e385bee06824792133f00cb..161c15e7896044c06133ec250ad99403b010d47c 100644 (file)
@@ -1698,7 +1698,8 @@ VariantDef::clone () const
     cloned_fields.push_back ((StructFieldType *) f->clone ());
 
   auto &&discriminant_opt = has_discriminant ()
-                             ? tl::optional (get_discriminant ().clone_expr ())
+                             ? tl::optional<std::unique_ptr<HIR::Expr>> (
+                               get_discriminant ().clone_expr ())
                              : tl::nullopt;
 
   return new VariantDef (id, defid, identifier, ident, type,
@@ -1713,7 +1714,8 @@ VariantDef::monomorphized_clone () const
     cloned_fields.push_back ((StructFieldType *) f->monomorphized_clone ());
 
   auto discriminant_opt = has_discriminant ()
-                           ? tl::optional (get_discriminant ().clone_expr ())
+                           ? tl::optional<std::unique_ptr<HIR::Expr>> (
+                             get_discriminant ().clone_expr ())
                            : tl::nullopt;
 
   return new VariantDef (id, defid, identifier, ident, type,