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/parse | |
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/parse')
-rw-r--r-- | gcc/rust/parse/rust-parse-impl.h | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index d5383ad..185217a 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<ManagedTokenSource>::parse_function_param () if (lexer.peek_token ()->get_id () == ELLIPSIS) // Unnamed variadic { lexer.skip_token (); // Skip ellipsis - return Rust::make_unique<AST::VariadicParam> ( + return std::make_unique<AST::VariadicParam> ( AST::VariadicParam (std::move (outer_attrs), locus)); } @@ -3705,7 +3704,7 @@ Parser<ManagedTokenSource>::parse_function_param () if (lexer.peek_token ()->get_id () == ELLIPSIS) // Named variadic { lexer.skip_token (); // Skip ellipsis - return Rust::make_unique<AST::VariadicParam> ( + return std::make_unique<AST::VariadicParam> ( AST::VariadicParam (std::move (param_pattern), std::move (outer_attrs), locus)); } @@ -3716,7 +3715,7 @@ Parser<ManagedTokenSource>::parse_function_param () { return nullptr; } - return Rust::make_unique<AST::FunctionParam> ( + return std::make_unique<AST::FunctionParam> ( AST::FunctionParam (std::move (param_pattern), std::move (param_type), std::move (outer_attrs), locus)); } @@ -7124,14 +7123,14 @@ Parser<ManagedTokenSource>::parse_self_param () if (has_reference) { - return Rust::make_unique<AST::SelfParam> (std::move (lifetime), has_mut, - locus); + return std::make_unique<AST::SelfParam> (std::move (lifetime), has_mut, + locus); } else { // note that type may be nullptr here and that's fine - return Rust::make_unique<AST::SelfParam> (std::move (type), has_mut, - locus); + return std::make_unique<AST::SelfParam> (std::move (type), has_mut, + locus); } } @@ -8693,10 +8692,10 @@ Parser<ManagedTokenSource>::parse_array_expr (AST::AttrVec outer_attrs, std::vector<std::unique_ptr<AST::Expr>> exprs; auto array_elems - = Rust::make_unique<AST::ArrayElemsValues> (std::move (exprs), locus); - return Rust::make_unique<AST::ArrayExpr> (std::move (array_elems), - std::move (inner_attrs), - std::move (outer_attrs), locus); + = std::make_unique<AST::ArrayElemsValues> (std::move (exprs), locus); + return std::make_unique<AST::ArrayExpr> (std::move (array_elems), + std::move (inner_attrs), + std::move (outer_attrs), locus); } else { |