From: Philip Herron <[email protected]>
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 <[email protected]>
---
gcc/rust/typecheck/rust-tyty.cc | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/gcc/rust/typecheck/rust-tyty.cc b/gcc/rust/typecheck/rust-tyty.cc
index c2e1bf438f7..161c15e7896 100644
--- a/gcc/rust/typecheck/rust-tyty.cc
+++ b/gcc/rust/typecheck/rust-tyty.cc
@@ -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,
--
2.50.1