aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/ast/rust-item.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h
index dcfc3d1..0578329 100644
--- a/gcc/rust/ast/rust-item.h
+++ b/gcc/rust/ast/rust-item.h
@@ -3535,7 +3535,16 @@ public:
void insert_implict_self (std::unique_ptr<AST::GenericParam> &&param)
{
- generic_params.push_back (std::move (param));
+ std::vector<std::unique_ptr<GenericParam>> new_list;
+ new_list.reserve (generic_params.size () + 1);
+
+ new_list.push_back (std::move (param));
+ for (auto &p : generic_params)
+ {
+ new_list.push_back (std::move (p));
+ }
+
+ generic_params = std::move (new_list);
}
protected: