From 19fa68dbb03a5a9a0ec357f7b9398471d69bdcd6 Mon Sep 17 00:00:00 2001 From: Sri Ganesh Thota Date: Tue, 10 Dec 2024 18:38:27 +0530 Subject: [PATCH] gccrs: Made changes to AST::TraitImpl constructor for TypePath gcc/rust/ChangeLog: * ast/rust-item.h: I have changed helper constructor for typepath to be a delegating constructor. Signed-off-by: Sri Ganesh Thota --- gcc/rust/ast/rust-item.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h index 02b305d816ee..4e3338a487ce 100644 --- a/gcc/rust/ast/rust-item.h +++ b/gcc/rust/ast/rust-item.h @@ -3197,19 +3197,18 @@ class TraitImpl : public Impl trait_path (std::move (trait_path)), impl_items (std::move (impl_items)) {} - // Helper constructor with a typepath + // Delegating constructor for TypePath TraitImpl (TypePath trait_path, bool is_unsafe, bool has_exclam, std::vector> impl_items, std::vector> generic_params, std::unique_ptr trait_type, WhereClause where_clause, Visibility vis, std::vector inner_attrs, std::vector outer_attrs, location_t locus) - : Impl (std::move (generic_params), std::move (trait_type), - std::move (where_clause), std::move (vis), std::move (inner_attrs), - std::move (outer_attrs), locus), - has_unsafe (is_unsafe), has_exclam (has_exclam), - trait_path (std::unique_ptr (new TypePath (trait_path))), - impl_items (std::move (impl_items)) + : TraitImpl (std::unique_ptr (new TypePath (trait_path)), is_unsafe, + has_exclam, std::move (impl_items), std::move (generic_params), + std::move (trait_type), std::move (where_clause), + std::move (vis), std::move (inner_attrs), + std::move (outer_attrs), locus) {} // Copy constructor with vector clone