aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/typecheck/rust-hir-type-check-enumitem.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/rust/typecheck/rust-hir-type-check-enumitem.cc b/gcc/rust/typecheck/rust-hir-type-check-enumitem.cc
index 7d8f7e4..ac85075 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-enumitem.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-enumitem.cc
@@ -142,10 +142,11 @@ TypeCheckEnumItem::visit (HIR::EnumItemDiscriminant &item)
rust_assert (canonical_path.has_value ());
RustIdent ident{*canonical_path, item.get_locus ()};
- variant = new TyTy::VariantDef (item.get_mappings ().get_hirid (),
- item.get_mappings ().get_defid (),
- item.get_identifier ().as_string (), ident,
- item.take_discriminant_expression ());
+ variant
+ = new TyTy::VariantDef (item.get_mappings ().get_hirid (),
+ item.get_mappings ().get_defid (),
+ item.get_identifier ().as_string (), ident,
+ item.get_discriminant_expression ().clone_expr ());
}
void