From ebf15ebbb64059f246db1464e4f4fb66f4fdf726 Mon Sep 17 00:00:00 2001 From: Owen Avery Date: Wed, 4 Dec 2024 15:23:07 -0500 Subject: [PATCH] Remove Rust::make_unique Since our bootstrap requirement has been bumped to C++14, we don't need a custom implementation of std::make_unique anymore. gcc/rust/ChangeLog: * ast/rust-ast-builder-type.cc: Remove inclusion of rust-make-unique.h. * ast/rust-ast-builder.cc: Likewise. (Builder::array): Use std::make_unique instead of Rust::make_unique. * ast/rust-ast.cc (Attribute::get_traits_to_derive): Likewise. * ast/rust-macro.h: Remove inclusion of rust-make-unique.h. (MacroRulesDefinition::mbe): Use std::make_unique instead of Rust::make_unique. (MacroRulesDefinition::decl_macro): Likewise. * ast/rust-path.h (PathInExpression::PathInExpression): Likewise. (QualifiedPathInExpression::QualifiedPathInExpression): Likewise. * backend/rust-compile-pattern.cc (CompilePatternCheckExpr::visit): Likewise. * expand/rust-expand-format-args.cc (expand_format_args): Likewise. * expand/rust-macro-builtins-asm.cc: Remove inclusion of rust-make-unique.h. (parse_asm): Use std::make_unique instead of Rust::make_unique. * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise. * hir/tree/rust-hir-expr.cc (StructExprStructFields::StructExprStructFields): Likewise. (StructExprStructFields::operator=): Likewise. * hir/tree/rust-hir.cc (TypePath::to_trait_bound): Likewise. * lex/rust-token.h: Remove inclusion of rust-make-unique.h. (Token::Token): Use std::make_unique instead of Rust::make_unique. * metadata/rust-import-archive.cc: Remove inclusion of rust-make-unique.h. (Import::find_archive_export_data): Use std::make_unique instead of Rust::make_unique. * metadata/rust-imports.cc: Remove inclusion of rust-make-unique.h. (Import::find_export_data): Use std::make_unique instead of Rust::make_unique. (Import::find_object_export_data): Likewise. * parse/rust-parse-impl.h: Remove inclusion of rust-make-unique.h. (Parser::parse_function_param): Use std::make_unique instead of Rust::make_unique. (Parser::parse_self_param): Likewise. (Parser::parse_array_expr): Likewise. * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Likewise. * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit): Likewise. (TypeCheckImplItem::visit): Likewise. * typecheck/rust-hir-type-check-type.cc (TypeResolveGenericParam::visit): Likewise. * typecheck/rust-hir-type-check.cc: Remove inclusion of rust-make-unique.h. (TraitItemReference::get_type_from_fn): Use std::make_unique instead of Rust::make_unique. * typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound): Likewise. * util/rust-make-unique.h: Removed. Signed-off-by: Owen Avery --- gcc/rust/ast/rust-ast-builder-type.cc | 1 - gcc/rust/ast/rust-ast-builder.cc | 3 +- gcc/rust/ast/rust-ast.cc | 4 +-- gcc/rust/ast/rust-macro.h | 5 ++- gcc/rust/ast/rust-path.h | 6 ++-- gcc/rust/backend/rust-compile-pattern.cc | 2 +- gcc/rust/expand/rust-expand-format-args.cc | 2 +- gcc/rust/expand/rust-macro-builtins-asm.cc | 7 ++-- gcc/rust/hir/rust-ast-lower-expr.cc | 2 +- gcc/rust/hir/tree/rust-hir-expr.cc | 16 +++++---- gcc/rust/hir/tree/rust-hir.cc | 4 +-- gcc/rust/lex/rust-token.h | 7 ++-- gcc/rust/metadata/rust-import-archive.cc | 5 ++- gcc/rust/metadata/rust-imports.cc | 5 ++- gcc/rust/parse/rust-parse-impl.h | 23 ++++++------ .../typecheck/rust-hir-type-check-enumitem.cc | 6 ++-- .../typecheck/rust-hir-type-check-implitem.cc | 4 +-- .../typecheck/rust-hir-type-check-type.cc | 2 +- gcc/rust/typecheck/rust-hir-type-check.cc | 3 +- gcc/rust/typecheck/rust-tyty-bounds.cc | 4 +-- gcc/rust/util/rust-make-unique.h | 35 ------------------- 21 files changed, 52 insertions(+), 94 deletions(-) delete mode 100644 gcc/rust/util/rust-make-unique.h diff --git a/gcc/rust/ast/rust-ast-builder-type.cc b/gcc/rust/ast/rust-ast-builder-type.cc index e76d0de0e9ae..13126b440571 100644 --- a/gcc/rust/ast/rust-ast-builder-type.cc +++ b/gcc/rust/ast/rust-ast-builder-type.cc @@ -20,7 +20,6 @@ #include "rust-ast-builder.h" #include "rust-ast-full.h" #include "rust-common.h" -#include "rust-make-unique.h" namespace Rust { namespace AST { diff --git a/gcc/rust/ast/rust-ast-builder.cc b/gcc/rust/ast/rust-ast-builder.cc index 121b8c8d7e0a..ac0eabc90ab4 100644 --- a/gcc/rust/ast/rust-ast-builder.cc +++ b/gcc/rust/ast/rust-ast-builder.cc @@ -21,7 +21,6 @@ #include "rust-common.h" #include "rust-expr.h" #include "rust-token.h" -#include "rust-make-unique.h" namespace Rust { namespace AST { @@ -45,7 +44,7 @@ Builder::call (std::unique_ptr &&path, std::unique_ptr Builder::array (std::vector> &&members) const { - auto elts = Rust::make_unique (std::move (members), loc); + auto elts = std::make_unique (std::move (members), loc); return std::unique_ptr (new ArrayExpr (std::move (elts), {}, {}, loc)); } diff --git a/gcc/rust/ast/rust-ast.cc b/gcc/rust/ast/rust-ast.cc index 27e62a923a5c..f5d6f20e2340 100644 --- a/gcc/rust/ast/rust-ast.cc +++ b/gcc/rust/ast/rust-ast.cc @@ -272,8 +272,8 @@ Attribute::get_traits_to_derive () case AST::MetaItem::ItemKind::Word: { auto word = static_cast (meta_item); // Convert current word to path - current - = make_unique (AST::MetaItemPath ( + current = std::make_unique ( + AST::MetaItemPath ( AST::SimplePath (word->get_ident ()))); auto path = static_cast (current.get ()); diff --git a/gcc/rust/ast/rust-macro.h b/gcc/rust/ast/rust-macro.h index 71cdcf0471ea..07a571561ba5 100644 --- a/gcc/rust/ast/rust-macro.h +++ b/gcc/rust/ast/rust-macro.h @@ -24,7 +24,6 @@ #include "rust-ast-fragment.h" #include "rust-location.h" #include "rust-item.h" -#include "rust-make-unique.h" #include "rust-macro-builtins.h" namespace Rust { @@ -521,7 +520,7 @@ class MacroRulesDefinition : public VisItem mbe (Identifier rule_name, DelimType delim_type, std::vector rules, std::vector outer_attrs, location_t locus) { - return Rust::make_unique ( + return std::make_unique ( MacroRulesDefinition (rule_name, delim_type, rules, outer_attrs, locus, AST::MacroRulesDefinition::MacroKind::MBE, AST::Visibility::create_error ())); @@ -532,7 +531,7 @@ class MacroRulesDefinition : public VisItem std::vector outer_attrs, location_t locus, Visibility vis) { - return Rust::make_unique (MacroRulesDefinition ( + return std::make_unique (MacroRulesDefinition ( rule_name, AST::DelimType::CURLY, rules, outer_attrs, locus, AST::MacroRulesDefinition::MacroKind::DeclMacro, vis)); } diff --git a/gcc/rust/ast/rust-path.h b/gcc/rust/ast/rust-path.h index 2df1506923d7..8ad3bc2a48da 100644 --- a/gcc/rust/ast/rust-path.h +++ b/gcc/rust/ast/rust-path.h @@ -701,8 +701,8 @@ class PathInExpression : public Pattern, public ExprWithoutBlock : outer_attrs (std::move (outer_attrs)), has_opening_scope_resolution (has_opening_scope_resolution), locus (locus), _node_id (Analysis::Mappings::get ().get_next_node_id ()), - path (Rust::make_unique (std::move (path_segments), locus, - _node_id)), + path (std::make_unique (std::move (path_segments), locus, + _node_id)), marked_for_strip (false) {} @@ -1401,7 +1401,7 @@ class QualifiedPathInExpression : public Pattern, public ExprWithoutBlock location_t locus) : outer_attrs (std::move (outer_attrs)), path_type (std::move (qual_path_type)), - path (Rust::make_unique ( + path (std::make_unique ( std::move (path_segments), locus, Analysis::Mappings::get ().get_next_node_id ())) {} diff --git a/gcc/rust/backend/rust-compile-pattern.cc b/gcc/rust/backend/rust-compile-pattern.cc index a1d2e68914f6..6cb337c300f2 100644 --- a/gcc/rust/backend/rust-compile-pattern.cc +++ b/gcc/rust/backend/rust-compile-pattern.cc @@ -80,7 +80,7 @@ void CompilePatternCheckExpr::visit (HIR::LiteralPattern &pattern) { // Compile the literal - auto litexpr = Rust::make_unique ( + auto litexpr = std::make_unique ( HIR::LiteralExpr (pattern.get_mappings (), pattern.get_literal (), pattern.get_locus (), std::vector ())); diff --git a/gcc/rust/expand/rust-expand-format-args.cc b/gcc/rust/expand/rust-expand-format-args.cc index 3f76344ea5bf..9b246ef087ca 100644 --- a/gcc/rust/expand/rust-expand-format-args.cc +++ b/gcc/rust/expand/rust-expand-format-args.cc @@ -120,7 +120,7 @@ expand_format_args (AST::FormatArgs &fmt, auto pieces = builder.ref (builder.array (std::move (static_pieces))); auto args_slice = builder.ref (builder.array (std::move (args_array))); - auto final_path = make_unique ( + auto final_path = std::make_unique ( builder.path_in_expression ({"core", "fmt", "Arguments", "new_v1"})); auto final_args = std::vector> (); final_args.emplace_back (std::move (pieces)); diff --git a/gcc/rust/expand/rust-macro-builtins-asm.cc b/gcc/rust/expand/rust-macro-builtins-asm.cc index dc319a008e0a..9ee2413d5d43 100644 --- a/gcc/rust/expand/rust-macro-builtins-asm.cc +++ b/gcc/rust/expand/rust-macro-builtins-asm.cc @@ -17,7 +17,6 @@ // . #include "expected.h" -#include "rust-make-unique.h" #include "rust-macro-builtins-asm.h" #include "rust-ast-fragment.h" #include "rust-ast.h" @@ -858,9 +857,9 @@ parse_asm (location_t invoc_locus, AST::MacroInvocData &invoc, // properly. if (semicolon == AST::InvocKind::Semicoloned) single_vec.emplace_back (AST::SingleASTNode ( - Rust::make_unique (std::move (node), invoc_locus, - semicolon - == AST::InvocKind::Semicoloned))); + std::make_unique (std::move (node), invoc_locus, + semicolon + == AST::InvocKind::Semicoloned))); else single_vec.emplace_back (AST::SingleASTNode (std::move (node))); diff --git a/gcc/rust/hir/rust-ast-lower-expr.cc b/gcc/rust/hir/rust-ast-lower-expr.cc index a8c07303bd1c..1b061b3d50da 100644 --- a/gcc/rust/hir/rust-ast-lower-expr.cc +++ b/gcc/rust/hir/rust-ast-lower-expr.cc @@ -518,7 +518,7 @@ ASTLoweringExpr::visit (AST::StructExprStructFields &struct_expr) HIR::Expr *translated_base = ASTLoweringExpr::translate ( struct_expr.get_struct_base ().get_base_struct ()); base = tl::optional> ( - Rust::make_unique ( + std::make_unique ( std::unique_ptr (translated_base))); } diff --git a/gcc/rust/hir/tree/rust-hir-expr.cc b/gcc/rust/hir/tree/rust-hir-expr.cc index 6c9a7a475e71..66bd5a7d5084 100644 --- a/gcc/rust/hir/tree/rust-hir-expr.cc +++ b/gcc/rust/hir/tree/rust-hir-expr.cc @@ -542,9 +542,10 @@ StructExprStructFields::StructExprStructFields ( StructExprStructFields const &other) : StructExprStruct (other), struct_base ( - other.has_struct_base () ? tl::optional> ( - Rust::make_unique (*other.struct_base.value ())) - : tl::nullopt), + other.has_struct_base () + ? tl::optional> ( + std::make_unique (*other.struct_base.value ())) + : tl::nullopt), union_index (other.union_index) { fields.reserve (other.fields.size ()); @@ -556,10 +557,11 @@ StructExprStructFields & StructExprStructFields::operator= (StructExprStructFields const &other) { StructExprStruct::operator= (other); - struct_base = other.has_struct_base () - ? tl::optional> ( - Rust::make_unique (*other.struct_base.value ())) - : tl::nullopt; + struct_base + = other.has_struct_base () + ? tl::optional> ( + std::make_unique (*other.struct_base.value ())) + : tl::nullopt; union_index = other.union_index; fields.reserve (other.fields.size ()); diff --git a/gcc/rust/hir/tree/rust-hir.cc b/gcc/rust/hir/tree/rust-hir.cc index 509a897ce39c..1e6187221f60 100644 --- a/gcc/rust/hir/tree/rust-hir.cc +++ b/gcc/rust/hir/tree/rust-hir.cc @@ -2710,8 +2710,8 @@ TypePath::to_trait_bound (bool in_parens) const // create clone FIXME is this required? or is copy constructor automatically // called? TypePath copy (*this); - return Rust::make_unique (mappings, std::move (copy), - copy.get_locus (), in_parens); + return std::make_unique (mappings, std::move (copy), + copy.get_locus (), in_parens); } std::string diff --git a/gcc/rust/lex/rust-token.h b/gcc/rust/lex/rust-token.h index 1a2a28682e15..09814c57e891 100644 --- a/gcc/rust/lex/rust-token.h +++ b/gcc/rust/lex/rust-token.h @@ -21,7 +21,6 @@ #include "rust-system.h" #include "rust-linemap.h" -#include "rust-make-unique.h" #include "rust-unicode.h" namespace Rust { @@ -268,7 +267,7 @@ class Token : token_id (token_id), locus (location), type_hint (CORETYPE_UNKNOWN) { // Normalize identifier tokens - str = Rust::make_unique ( + str = std::make_unique ( nfc_normalize_token_string (location, token_id, paramStr)); } @@ -285,7 +284,7 @@ class Token : token_id (token_id), locus (location), type_hint (CORETYPE_UNKNOWN) { // Normalize identifier tokens - str = Rust::make_unique ( + str = std::make_unique ( nfc_normalize_token_string (location, token_id, paramCodepoint.as_string ())); } @@ -296,7 +295,7 @@ class Token : token_id (token_id), locus (location), type_hint (parType) { // Normalize identifier tokens - str = Rust::make_unique ( + str = std::make_unique ( nfc_normalize_token_string (location, token_id, paramStr)); } diff --git a/gcc/rust/metadata/rust-import-archive.cc b/gcc/rust/metadata/rust-import-archive.cc index 6c392b00b4bf..cf24607f099c 100644 --- a/gcc/rust/metadata/rust-import-archive.cc +++ b/gcc/rust/metadata/rust-import-archive.cc @@ -7,7 +7,6 @@ #include "rust-system.h" #include "rust-diagnostics.h" #include "rust-imports.h" -#include "rust-make-unique.h" #ifndef O_BINARY #define O_BINARY 0 @@ -844,7 +843,7 @@ Import::find_archive_export_data (const std::string &filename, int fd, if (!afile.initialize ()) return nullptr; - auto ret = Rust::make_unique (); + auto ret = std::make_unique (); bool any_data = false; bool any_members = false; @@ -872,7 +871,7 @@ Import::find_archive_export_data (const std::string &filename, int fd, if (!any_members) { // It's normal to have an empty archive file when using gobuild. - return Rust::make_unique (""); + return std::make_unique (""); } if (!any_data) diff --git a/gcc/rust/metadata/rust-imports.cc b/gcc/rust/metadata/rust-imports.cc index 17451fbcb9ba..9352a6b22c9e 100644 --- a/gcc/rust/metadata/rust-imports.cc +++ b/gcc/rust/metadata/rust-imports.cc @@ -21,7 +21,6 @@ #include "rust-imports.h" #include "rust-object-export.h" #include "rust-export-metadata.h" -#include "rust-make-unique.h" #ifndef O_BINARY #define O_BINARY 0 @@ -259,7 +258,7 @@ Import::find_export_data (const std::string &filename, int fd, // if (memcmp (buf, Metadata::kMagicHeader, sizeof (Metadata::kMagicHeader)) == 0) - return Rust::make_unique (fd); + return std::make_unique (fd); // See if we can read this as an archive. if (Import::is_archive_magic (buf)) @@ -291,7 +290,7 @@ Import::find_object_export_data (const std::string &filename, int fd, if (buf == nullptr) return nullptr; - return Rust::make_unique (buf, len); + return std::make_unique (buf, len); } // Class Import. diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index aff81448deae..65d6a79f571c 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -29,7 +29,6 @@ #include "rust-token.h" #define INCLUDE_ALGORITHM #include "rust-diagnostics.h" -#include "rust-make-unique.h" #include "rust-dir-owner.h" #include "rust-attribute-values.h" #include "rust-keyword-values.h" @@ -3683,7 +3682,7 @@ Parser::parse_function_param () if (lexer.peek_token ()->get_id () == ELLIPSIS) // Unnamed variadic { lexer.skip_token (); // Skip ellipsis - return Rust::make_unique ( + return std::make_unique ( AST::VariadicParam (std::move (outer_attrs), locus)); } @@ -3705,7 +3704,7 @@ Parser::parse_function_param () if (lexer.peek_token ()->get_id () == ELLIPSIS) // Named variadic { lexer.skip_token (); // Skip ellipsis - return Rust::make_unique ( + return std::make_unique ( AST::VariadicParam (std::move (param_pattern), std::move (outer_attrs), locus)); } @@ -3716,7 +3715,7 @@ Parser::parse_function_param () { return nullptr; } - return Rust::make_unique ( + return std::make_unique ( AST::FunctionParam (std::move (param_pattern), std::move (param_type), std::move (outer_attrs), locus)); } @@ -7124,14 +7123,14 @@ Parser::parse_self_param () if (has_reference) { - return Rust::make_unique (std::move (lifetime), has_mut, - locus); + return std::make_unique (std::move (lifetime), has_mut, + locus); } else { // note that type may be nullptr here and that's fine - return Rust::make_unique (std::move (type), has_mut, - locus); + return std::make_unique (std::move (type), has_mut, + locus); } } @@ -8693,10 +8692,10 @@ Parser::parse_array_expr (AST::AttrVec outer_attrs, std::vector> exprs; auto array_elems - = Rust::make_unique (std::move (exprs), locus); - return Rust::make_unique (std::move (array_elems), - std::move (inner_attrs), - std::move (outer_attrs), locus); + = std::make_unique (std::move (exprs), locus); + return std::make_unique (std::move (array_elems), + std::move (inner_attrs), + std::move (outer_attrs), locus); } else { diff --git a/gcc/rust/typecheck/rust-hir-type-check-enumitem.cc b/gcc/rust/typecheck/rust-hir-type-check-enumitem.cc index 5e6087d78b22..7d8f7e4c2655 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-enumitem.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-enumitem.cc @@ -69,7 +69,7 @@ TypeCheckEnumItem::visit (HIR::EnumItem &item) mappings.get_next_hir_id ( item.get_mappings ().get_crate_num ()), item.get_mappings ().get_local_defid ()); - auto discim_expr = Rust::make_unique ( + auto discim_expr = std::make_unique ( HIR::LiteralExpr (mapping, std::to_string (last_discriminant), HIR::Literal::LitType::INT, PrimitiveCoreType::CORETYPE_I64, item.get_locus (), {})); @@ -174,7 +174,7 @@ TypeCheckEnumItem::visit (HIR::EnumItemTuple &item) mappings.get_next_hir_id ( item.get_mappings ().get_crate_num ()), item.get_mappings ().get_local_defid ()); - auto discim_expr = Rust::make_unique ( + auto discim_expr = std::make_unique ( HIR::LiteralExpr (mapping, std::to_string (last_discriminant), HIR::Literal::LitType::INT, PrimitiveCoreType::CORETYPE_I64, item.get_locus (), {})); @@ -234,7 +234,7 @@ TypeCheckEnumItem::visit (HIR::EnumItemStruct &item) mappings.get_next_hir_id ( item.get_mappings ().get_crate_num ()), item.get_mappings ().get_local_defid ()); - auto discrim_expr = Rust::make_unique ( + auto discrim_expr = std::make_unique ( HIR::LiteralExpr (mapping, std::to_string (last_discriminant), HIR::Literal::LitType::INT, PrimitiveCoreType::CORETYPE_I64, item.get_locus (), {})); diff --git a/gcc/rust/typecheck/rust-hir-type-check-implitem.cc b/gcc/rust/typecheck/rust-hir-type-check-implitem.cc index a72ab9731d1d..fac96b1a8b39 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-implitem.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-implitem.cc @@ -142,7 +142,7 @@ TypeCheckTopLevelExternItem::visit (HIR::ExternalFunctionItem &function) mappings.get_next_hir_id (crate_num), UNKNOWN_LOCAL_DEFID); - auto param_pattern = Rust::make_unique ( + auto param_pattern = std::make_unique ( HIR::IdentifierPattern (mapping, param.get_param_name (), UNDEF_LOCATION, false, Mutability::Imm, std::unique_ptr (nullptr))); @@ -390,7 +390,7 @@ TypeCheckImplItem::visit (HIR::Function &function) HIR::SelfParam &self_param = function.get_self_param (); // FIXME: which location should be used for Rust::Identifier for `self`? std::unique_ptr self_pattern - = Rust::make_unique ( + = std::make_unique ( HIR::IdentifierPattern (mapping, {"self"}, self_param.get_locus (), self_param.is_ref (), self_param.get_mut (), std::unique_ptr (nullptr))); diff --git a/gcc/rust/typecheck/rust-hir-type-check-type.cc b/gcc/rust/typecheck/rust-hir-type-check-type.cc index aaff8db99bad..fcd29a2bfde1 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-type.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-type.cc @@ -919,7 +919,7 @@ TypeResolveGenericParam::visit (HIR::TypeParam ¶m) param.get_mappings ().get_nodeid (), implicit_id, param.get_mappings ().get_local_defid ()); - implicit_self_bound = Rust::make_unique ( + implicit_self_bound = std::make_unique ( HIR::TypePath (mappings, {}, BUILTINS_LOCATION, false)); } diff --git a/gcc/rust/typecheck/rust-hir-type-check.cc b/gcc/rust/typecheck/rust-hir-type-check.cc index a30408c0b7f7..1e9f7d2f00dd 100644 --- a/gcc/rust/typecheck/rust-hir-type-check.cc +++ b/gcc/rust/typecheck/rust-hir-type-check.cc @@ -24,7 +24,6 @@ #include "rust-hir-type-check-item.h" #include "rust-hir-type-check-pattern.h" #include "rust-hir-type-check-struct-field.h" -#include "rust-make-unique.h" #include "rust-immutable-name-resolution-context.h" // for flag_name_resolution_2_0 @@ -238,7 +237,7 @@ TraitItemReference::get_type_from_fn (/*const*/ HIR::TraitItemFunc &fn) const // but we reuse the HIR identifier pattern which requires it HIR::SelfParam &self_param = function.get_self (); std::unique_ptr self_pattern - = Rust::make_unique (HIR::IdentifierPattern ( + = std::make_unique (HIR::IdentifierPattern ( mapping, {"self"}, self_param.get_locus (), self_param.is_ref (), self_param.is_mut () ? Mutability::Mut : Mutability::Imm, std::unique_ptr (nullptr))); diff --git a/gcc/rust/typecheck/rust-tyty-bounds.cc b/gcc/rust/typecheck/rust-tyty-bounds.cc index a5f415a33d4c..23df46c323e8 100644 --- a/gcc/rust/typecheck/rust-tyty-bounds.cc +++ b/gcc/rust/typecheck/rust-tyty-bounds.cc @@ -237,8 +237,8 @@ TypeCheckBase::get_predicate_from_bound ( std::vector> inputs; inputs.push_back ( - Rust::make_unique (mapping, std::move (params_copy), - final_seg.get_locus ())); + std::make_unique (mapping, std::move (params_copy), + final_seg.get_locus ())); // resolve the fn_once_output type which assumes there must be an output // set diff --git a/gcc/rust/util/rust-make-unique.h b/gcc/rust/util/rust-make-unique.h deleted file mode 100644 index 09c1d4b3fee8..000000000000 --- a/gcc/rust/util/rust-make-unique.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2020-2024 Free Software Foundation, Inc. - -// This file is part of GCC. - -// GCC is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 3, or (at your option) any later -// version. - -// GCC is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. - -// You should have received a copy of the GNU General Public License -// along with GCC; see the file COPYING3. If not see -// . - -#ifndef RUST_MAKE_UNIQUE_H -#define RUST_MAKE_UNIQUE_H - -#include "rust-system.h" - -namespace Rust { - -template -std::unique_ptr -make_unique (Ts &&... params) -{ - return std::unique_ptr (new T (std::forward (params)...)); -} - -} // namespace Rust - -#endif // RUST_MAKE_UNIQUE_H