diff options
author | Owen Avery <powerboat9.gamer@gmail.com> | 2024-12-04 15:23:07 -0500 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-03-21 12:55:44 +0100 |
commit | c8721ccdeb45396c5acf53da058a0fe1e3d03590 (patch) | |
tree | 470e761ca965bb91cebfa5e5d59e9403be5e7200 /gcc/rust/ast | |
parent | e9a3e00c1be9ae548faa9baffec355de3d3cf589 (diff) | |
download | gcc-c8721ccdeb45396c5acf53da058a0fe1e3d03590.zip gcc-c8721ccdeb45396c5acf53da058a0fe1e3d03590.tar.gz gcc-c8721ccdeb45396c5acf53da058a0fe1e3d03590.tar.bz2 |
gccrs: 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-derive-copy.cc
(DeriveCopy::copy_impl): 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 <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc/rust/ast')
-rw-r--r-- | gcc/rust/ast/rust-ast-builder-type.cc | 1 | ||||
-rw-r--r-- | gcc/rust/ast/rust-ast-builder.cc | 3 | ||||
-rw-r--r-- | gcc/rust/ast/rust-ast.cc | 4 | ||||
-rw-r--r-- | gcc/rust/ast/rust-macro.h | 5 | ||||
-rw-r--r-- | gcc/rust/ast/rust-path.h | 8 |
5 files changed, 9 insertions, 12 deletions
diff --git a/gcc/rust/ast/rust-ast-builder-type.cc b/gcc/rust/ast/rust-ast-builder-type.cc index e76d0de..13126b4 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 2fb041a..22fb0d8 100644 --- a/gcc/rust/ast/rust-ast-builder.cc +++ b/gcc/rust/ast/rust-ast-builder.cc @@ -22,7 +22,6 @@ #include "rust-expr.h" #include "rust-path.h" #include "rust-token.h" -#include "rust-make-unique.h" namespace Rust { namespace AST { @@ -73,7 +72,7 @@ Builder::call (std::unique_ptr<Path> &&path, std::unique_ptr<Expr> &&arg) const std::unique_ptr<Expr> Builder::array (std::vector<std::unique_ptr<Expr>> &&members) const { - auto elts = Rust::make_unique<ArrayElemsValues> (std::move (members), loc); + auto elts = std::make_unique<ArrayElemsValues> (std::move (members), loc); return std::unique_ptr<Expr> (new ArrayExpr (std::move (elts), {}, {}, loc)); } diff --git a/gcc/rust/ast/rust-ast.cc b/gcc/rust/ast/rust-ast.cc index f1298d0..06a7a09 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<AST::MetaWord *> (meta_item); // Convert current word to path - current - = make_unique<AST::MetaItemPath> (AST::MetaItemPath ( + current = std::make_unique<AST::MetaItemPath> ( + AST::MetaItemPath ( AST::SimplePath (word->get_ident ()))); auto path = static_cast<AST::MetaItemPath *> (current.get ()); diff --git a/gcc/rust/ast/rust-macro.h b/gcc/rust/ast/rust-macro.h index 76b3b2a..a953b75 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 @@ public: mbe (Identifier rule_name, DelimType delim_type, std::vector<MacroRule> rules, std::vector<Attribute> outer_attrs, location_t locus) { - return Rust::make_unique<MacroRulesDefinition> ( + return std::make_unique<MacroRulesDefinition> ( MacroRulesDefinition (rule_name, delim_type, rules, outer_attrs, locus, AST::MacroRulesDefinition::MacroKind::MBE, AST::Visibility::create_error ())); @@ -532,7 +531,7 @@ public: std::vector<Attribute> outer_attrs, location_t locus, Visibility vis) { - return Rust::make_unique<MacroRulesDefinition> (MacroRulesDefinition ( + return std::make_unique<MacroRulesDefinition> (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 39d42fd..4e26b2f 100644 --- a/gcc/rust/ast/rust-path.h +++ b/gcc/rust/ast/rust-path.h @@ -710,8 +710,8 @@ public: : 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<RegularPath> (std::move (path_segments), locus, - _node_id)), + path (std::make_unique<RegularPath> (std::move (path_segments), locus, + _node_id)), marked_for_strip (false) {} @@ -720,7 +720,7 @@ public: : outer_attrs (std::move (outer_attrs)), has_opening_scope_resolution (false), locus (locus), _node_id (Analysis::Mappings::get ().get_next_node_id ()), - path (Rust::make_unique<LangItemPath> (lang_item_kind, locus)), + path (std::make_unique<LangItemPath> (lang_item_kind, locus)), marked_for_strip (false) {} @@ -1439,7 +1439,7 @@ public: location_t locus) : outer_attrs (std::move (outer_attrs)), path_type (std::move (qual_path_type)), - path (Rust::make_unique<RegularPath> ( + path (std::make_unique<RegularPath> ( std::move (path_segments), locus, Analysis::Mappings::get ().get_next_node_id ())) {} |