diff options
Diffstat (limited to 'gcc/rust/expand/rust-derive-clone.cc')
| -rw-r--r-- | gcc/rust/expand/rust-derive-clone.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/rust/expand/rust-derive-clone.cc b/gcc/rust/expand/rust-derive-clone.cc index 321fa00..27dcc66 100644 --- a/gcc/rust/expand/rust-derive-clone.cc +++ b/gcc/rust/expand/rust-derive-clone.cc @@ -64,11 +64,10 @@ DeriveClone::clone_fn (std::unique_ptr<Expr> &&clone_expr) new BlockExpr ({}, std::move (clone_expr), {}, {}, tl::nullopt, loc, loc)); auto big_self_type = builder.single_type_path ("Self"); - std::unique_ptr<SelfParam> self (new SelfParam (tl::nullopt, - /* is_mut */ false, loc)); - std::vector<std::unique_ptr<Param>> params; - params.push_back (std::move (self)); + + params.emplace_back (new SelfParam (tl::nullopt, + /* is_mut */ false, loc)); return std::unique_ptr<AssociatedItem> ( new Function ({"clone"}, builder.fn_qualifiers (), /* generics */ {}, @@ -211,7 +210,7 @@ DeriveClone::clone_enum_tuple (PathInExpression variant_path, } auto pattern_items = std::unique_ptr<TupleStructItems> ( - new TupleStructItemsNoRange (std::move (patterns))); + new TupleStructItemsNoRest (std::move (patterns))); auto pattern = std::unique_ptr<Pattern> (new ReferencePattern ( std::unique_ptr<Pattern> (new TupleStructPattern ( |
