From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id B685E389851A; Mon, 5 Dec 2022 09:52:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B685E389851A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670233961; bh=11Tf/XuNiviuD8XMPEYygHsrtU7AmIhhIrinetznIFQ=; h=From:To:Subject:Date:From; b=P3QFIHCIBtp5gJ14vYwRNqCVKW3QUH9SNjaxcL/RDKHlNLTd0Td1IXNA3RXefQpUs B+oR21FJevv77xDUzVgIdWc/cVHl9F9S/AK56TJ+s0J4gqpopFNKyn6nMDlQ8ZIvi8 wdIqurywHc9iln9cC3TlL41ZeUN/23UY5rPqbzm8= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] Revert "rust: Remove unused variables and fix dangling references" X-Act-Checkin: gcc X-Git-Author: Philip Herron X-Git-Refname: refs/heads/devel/rust/master X-Git-Oldrev: 0bf68cf5e6199ce7deb3d0744ced09dd4db1b1c9 X-Git-Newrev: 9da783d1b71bb5e8add0cf74527786d0e4255803 Message-Id: <20221205095241.B685E389851A@sourceware.org> Date: Mon, 5 Dec 2022 09:52:41 +0000 (GMT) List-Id: https://gcc.gnu.org/g:9da783d1b71bb5e8add0cf74527786d0e4255803 commit 9da783d1b71bb5e8add0cf74527786d0e4255803 Author: Philip Herron Date: Sun Dec 4 15:27:26 2022 +0000 Revert "rust: Remove unused variables and fix dangling references" This reverts commit 9657c328d0cdda49b7985c3ee727781a387e128b. Diff: --- gcc/rust/backend/rust-compile-base.cc | 4 +- gcc/rust/backend/rust-compile-base.h | 6 +- gcc/rust/backend/rust-compile-expr.cc | 61 ++-- gcc/rust/backend/rust-compile-expr.h | 13 +- gcc/rust/backend/rust-compile-fnparam.cc | 2 +- gcc/rust/backend/rust-compile-implitem.h | 2 +- gcc/rust/backend/rust-compile-intrinsic.cc | 2 +- gcc/rust/backend/rust-compile-pattern.cc | 2 +- gcc/rust/backend/rust-compile-resolve-path.cc | 12 +- gcc/rust/backend/rust-compile-resolve-path.h | 3 +- gcc/rust/backend/rust-compile-type.cc | 8 +- gcc/rust/backend/rust-compile.cc | 12 +- gcc/rust/backend/rust-constexpr.cc | 6 +- gcc/rust/backend/rust-tree.cc | 38 ++- .../checks/errors/privacy/rust-privacy-reporter.cc | 58 ++-- .../checks/errors/privacy/rust-reachability.cc | 4 +- .../errors/privacy/rust-visibility-resolver.cc | 8 +- gcc/rust/checks/errors/rust-const-checker.cc | 132 ++++---- gcc/rust/checks/errors/rust-unsafe-checker.cc | 142 ++++----- gcc/rust/checks/lints/rust-lint-marklive.cc | 2 +- gcc/rust/checks/lints/rust-lint-unused-var.cc | 2 +- gcc/rust/expand/rust-macro-builtins.cc | 20 +- gcc/rust/hir/rust-ast-lower-base.cc | 352 ++++++++++----------- gcc/rust/hir/rust-hir-dump.cc | 4 +- gcc/rust/hir/tree/rust-hir-full-test.cc | 2 +- gcc/rust/lex/rust-lex.cc | 6 +- gcc/rust/lex/rust-lex.h | 2 +- gcc/rust/metadata/rust-export-metadata.cc | 24 +- gcc/rust/resolve/rust-ast-resolve-expr.cc | 6 +- gcc/rust/resolve/rust-ast-resolve-type.cc | 6 +- gcc/rust/resolve/rust-ast-verify-assignee.h | 8 +- gcc/rust/resolve/rust-early-name-resolver.cc | 120 +++---- gcc/rust/typecheck/rust-hir-dot-operator.cc | 4 +- .../typecheck/rust-hir-inherent-impl-overlap.h | 7 +- gcc/rust/typecheck/rust-hir-path-probe.cc | 2 +- gcc/rust/typecheck/rust-hir-trait-ref.h | 6 +- gcc/rust/typecheck/rust-hir-trait-resolve.cc | 2 +- gcc/rust/typecheck/rust-hir-type-check-expr.cc | 2 +- gcc/rust/typecheck/rust-hir-type-check-expr.h | 32 +- gcc/rust/typecheck/rust-hir-type-check-item.h | 4 +- gcc/rust/typecheck/rust-hir-type-check-path.cc | 2 +- gcc/rust/typecheck/rust-hir-type-check-pattern.cc | 10 +- gcc/rust/typecheck/rust-hir-type-check-stmt.h | 9 +- gcc/rust/typecheck/rust-hir-type-check-type.cc | 10 +- gcc/rust/typecheck/rust-hir-type-check-type.h | 10 +- gcc/rust/typecheck/rust-hir-type-check.cc | 3 +- gcc/rust/typecheck/rust-tyty-bounds.cc | 2 +- gcc/rust/typecheck/rust-tyty-call.h | 2 +- gcc/rust/typecheck/rust-tyty-cmp.h | 16 +- gcc/rust/typecheck/rust-tyty-rules.h | 48 +-- gcc/rust/typecheck/rust-tyty.cc | 7 +- gcc/rust/util/rust-attributes.cc | 312 +++++++++--------- 52 files changed, 806 insertions(+), 753 deletions(-) diff --git a/gcc/rust/backend/rust-compile-base.cc b/gcc/rust/backend/rust-compile-base.cc index 54f7a7d1357..a5643d2f625 100644 --- a/gcc/rust/backend/rust-compile-base.cc +++ b/gcc/rust/backend/rust-compile-base.cc @@ -354,7 +354,7 @@ HIRCompileBase::setup_abi_options (tree fndecl, ABI abi) // it is fine to use ARRAY_REFs for vector subscripts on vector // register variables. bool -HIRCompileBase::mark_addressable (tree exp) +HIRCompileBase::mark_addressable (tree exp, Location locus) { tree x = exp; @@ -418,7 +418,7 @@ HIRCompileBase::address_expression (tree expr, Location location) if (expr == error_mark_node) return error_mark_node; - if (!mark_addressable (expr)) + if (!mark_addressable (expr, location)) return error_mark_node; return build_fold_addr_expr_loc (location.gcc_location (), expr); diff --git a/gcc/rust/backend/rust-compile-base.h b/gcc/rust/backend/rust-compile-base.h index 0dd2549ffa8..4c20933cafc 100644 --- a/gcc/rust/backend/rust-compile-base.h +++ b/gcc/rust/backend/rust-compile-base.h @@ -55,7 +55,7 @@ protected: const TyTy::TypeBoundPredicate *predicate, std::vector> &receiver_bounds, - const TyTy::BaseType *root, Location locus); + const TyTy::BaseType *receiver, const TyTy::BaseType *root, Location locus); bool verify_array_capacities (tree ltype, tree rtype, Location ltype_locus, Location rtype_locus); @@ -63,7 +63,7 @@ protected: tree query_compile (HirId ref, TyTy::BaseType *lookup, const HIR::PathIdentSegment &final_segment, const Analysis::NodeMapping &mappings, - Location expr_locus); + Location expr_locus, bool is_qualified_path); tree resolve_adjustements (std::vector &adjustments, tree expression, Location locus); @@ -113,7 +113,7 @@ protected: static tree indirect_expression (tree expr, Location locus); - static bool mark_addressable (tree); + static bool mark_addressable (tree, Location); static std::vector compile_locals_for_block (Context *ctx, Resolver::Rib &rib, tree fndecl); diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc index 87794cdfb69..b077a12f7a3 100644 --- a/gcc/rust/backend/rust-compile-expr.cc +++ b/gcc/rust/backend/rust-compile-expr.cc @@ -1814,15 +1814,17 @@ CompileExpr::visit (HIR::MethodCallExpr &expr) fn_expr = get_fn_addr_from_dyn (dyn, receiver, fntype, self, expr.get_locus ()); - self = get_receiver_from_dyn (receiver, self, expr.get_locus ()); + self = get_receiver_from_dyn (dyn, receiver, fntype, self, + expr.get_locus ()); } else { // lookup compiled functions since it may have already been compiled HIR::PathExprSegment method_name = expr.get_method_name (); HIR::PathIdentSegment segment_name = method_name.get_segment (); - fn_expr = resolve_method_address (fntype, ref, receiver, segment_name, - expr.get_locus ()); + fn_expr + = resolve_method_address (fntype, ref, receiver, segment_name, + expr.get_mappings (), expr.get_locus ()); } // lookup the autoderef mappings @@ -1923,7 +1925,9 @@ CompileExpr::get_fn_addr_from_dyn (const TyTy::DynamicObjectType *dyn, } tree -CompileExpr::get_receiver_from_dyn (TyTy::BaseType *receiver, tree receiver_ref, +CompileExpr::get_receiver_from_dyn (const TyTy::DynamicObjectType *dyn, + TyTy::BaseType *receiver, + TyTy::FnType *fntype, tree receiver_ref, Location expr_locus) { // get any indirection sorted out @@ -1942,6 +1946,7 @@ tree CompileExpr::resolve_method_address (TyTy::FnType *fntype, HirId ref, TyTy::BaseType *receiver, HIR::PathIdentSegment &segment, + Analysis::NodeMapping expr_mappings, Location expr_locus) { // lookup compiled functions since it may have already been compiled @@ -2011,7 +2016,7 @@ CompileExpr::resolve_method_address (TyTy::FnType *fntype, HirId ref, // implementation and we should just return error_mark_node rust_assert (candidates.size () == 1); - auto candidate = *candidates.begin (); + auto &candidate = *candidates.begin (); rust_assert (candidate.is_impl_candidate ()); rust_assert (candidate.ty->get_kind () == TyTy::TypeKind::FNDEF); TyTy::FnType *candidate_call = static_cast (candidate.ty); @@ -2035,8 +2040,7 @@ CompileExpr::resolve_method_address (TyTy::FnType *fntype, HirId ref, tree CompileExpr::resolve_operator_overload ( Analysis::RustLangItem::ItemType lang_item_type, HIR::OperatorExprMeta expr, - tree lhs, tree rhs, HIR::Expr *lhs_expr, - HIR::Expr * /* rhs_expr // FIXME: Reuse when needed */) + tree lhs, tree rhs, HIR::Expr *lhs_expr, HIR::Expr *rhs_expr) { TyTy::FnType *fntype; bool is_op_overload = ctx->get_tyctx ()->lookup_operator_overload ( @@ -2069,8 +2073,9 @@ CompileExpr::resolve_operator_overload ( // lookup compiled functions since it may have already been compiled HIR::PathIdentSegment segment_name ( Analysis::RustLangItem::ToString (lang_item_type)); - tree fn_expr = resolve_method_address (fntype, ref, receiver, segment_name, - expr.get_locus ()); + tree fn_expr + = resolve_method_address (fntype, ref, receiver, segment_name, + expr.get_mappings (), expr.get_locus ()); // lookup the autoderef mappings std::vector *adjustments = nullptr; @@ -2091,9 +2096,8 @@ CompileExpr::resolve_operator_overload ( } tree -CompileExpr::compile_bool_literal ( - const HIR::LiteralExpr &expr, - const TyTy::BaseType * /* tyty FIXME: Reuse when needed */) +CompileExpr::compile_bool_literal (const HIR::LiteralExpr &expr, + const TyTy::BaseType *tyty) { rust_assert (expr.get_lit_type () == HIR::Literal::BOOL); @@ -2175,9 +2179,8 @@ CompileExpr::compile_float_literal (const HIR::LiteralExpr &expr, } tree -CompileExpr::compile_char_literal ( - const HIR::LiteralExpr &expr, - const TyTy::BaseType * /* tyty FIXME: Reuse when needed */) +CompileExpr::compile_char_literal (const HIR::LiteralExpr &expr, + const TyTy::BaseType *tyty) { rust_assert (expr.get_lit_type () == HIR::Literal::CHAR); const auto literal_value = expr.get_literal (); @@ -2356,6 +2359,8 @@ CompileExpr::visit (HIR::ArrayExpr &expr) } rust_assert (tyty->get_kind () == TyTy::TypeKind::ARRAY); + const TyTy::ArrayType &array_tyty + = static_cast (*tyty); HIR::ArrayElems &elements = *expr.get_internal_elements (); switch (elements.get_array_expr_type ()) @@ -2363,20 +2368,23 @@ CompileExpr::visit (HIR::ArrayExpr &expr) case HIR::ArrayElems::ArrayExprType::VALUES: { HIR::ArrayElemsValues &elems = static_cast (elements); - translated = array_value_expr (expr.get_locus (), array_type, elems); + translated + = array_value_expr (expr.get_locus (), array_tyty, array_type, elems); } return; case HIR::ArrayElems::ArrayExprType::COPIED: HIR::ArrayElemsCopied &elems = static_cast (elements); - translated = array_copied_expr (expr.get_locus (), array_type, elems); + translated + = array_copied_expr (expr.get_locus (), array_tyty, array_type, elems); } } tree -CompileExpr::array_value_expr (Location expr_locus, tree array_type, - HIR::ArrayElemsValues &elems) +CompileExpr::array_value_expr (Location expr_locus, + const TyTy::ArrayType &array_tyty, + tree array_type, HIR::ArrayElemsValues &elems) { std::vector indexes; std::vector constructor; @@ -2394,8 +2402,9 @@ CompileExpr::array_value_expr (Location expr_locus, tree array_type, } tree -CompileExpr::array_copied_expr (Location expr_locus, tree array_type, - HIR::ArrayElemsCopied &elems) +CompileExpr::array_copied_expr (Location expr_locus, + const TyTy::ArrayType &array_tyty, + tree array_type, HIR::ArrayElemsCopied &elems) { // see gcc/cp/typeck2.cc:1369-1401 gcc_assert (TREE_CODE (array_type) == ARRAY_TYPE); @@ -2557,8 +2566,7 @@ HIRCompileBase::resolve_deref_adjustment (Resolver::Adjustment &adjustment, tree HIRCompileBase::resolve_indirection_adjustment ( - Resolver::Adjustment & /* adjustment FIXME: Reuse when needed */, - tree expression, Location locus) + Resolver::Adjustment &adjustment, tree expression, Location locus) { return indirect_expression (expression, locus); } @@ -2971,13 +2979,14 @@ CompileExpr::generate_closure_function (HIR::ClosureExpr &expr, } tree -CompileExpr::generate_closure_fntype (HIR::ClosureExpr &, +CompileExpr::generate_closure_fntype (HIR::ClosureExpr &expr, const TyTy::ClosureType &closure_tyty, - tree, TyTy::FnType **fn_tyty) + tree compiled_closure_tyty, + TyTy::FnType **fn_tyty) { // grab the specified_bound rust_assert (closure_tyty.num_specified_bounds () == 1); - const TyTy::TypeBoundPredicate predicate + const TyTy::TypeBoundPredicate &predicate = *closure_tyty.get_specified_bounds ().begin (); // ensure the fn_once_output associated type is set diff --git a/gcc/rust/backend/rust-compile-expr.h b/gcc/rust/backend/rust-compile-expr.h index 98d322a45a7..a259daf0d69 100644 --- a/gcc/rust/backend/rust-compile-expr.h +++ b/gcc/rust/backend/rust-compile-expr.h @@ -97,12 +97,14 @@ protected: TyTy::BaseType *receiver, TyTy::FnType *fntype, tree receiver_ref, Location expr_locus); - tree get_receiver_from_dyn (TyTy::BaseType *receiver, tree receiver_ref, - Location expr_locus); + tree get_receiver_from_dyn (const TyTy::DynamicObjectType *dyn, + TyTy::BaseType *receiver, TyTy::FnType *fntype, + tree receiver_ref, Location expr_locus); tree resolve_method_address (TyTy::FnType *fntype, HirId ref, TyTy::BaseType *receiver, HIR::PathIdentSegment &segment, + Analysis::NodeMapping expr_mappings, Location expr_locus); tree @@ -133,10 +135,11 @@ protected: tree type_cast_expression (tree type_to_cast_to, tree expr, Location locus); - tree array_value_expr (Location expr_locus, tree array_type, - HIR::ArrayElemsValues &elems); + tree array_value_expr (Location expr_locus, const TyTy::ArrayType &array_tyty, + tree array_type, HIR::ArrayElemsValues &elems); - tree array_copied_expr (Location expr_locus, tree array_type, + tree array_copied_expr (Location expr_locus, + const TyTy::ArrayType &array_tyty, tree array_type, HIR::ArrayElemsCopied &elems); protected: diff --git a/gcc/rust/backend/rust-compile-fnparam.cc b/gcc/rust/backend/rust-compile-fnparam.cc index 7a38e763fd0..3f0ec82b625 100644 --- a/gcc/rust/backend/rust-compile-fnparam.cc +++ b/gcc/rust/backend/rust-compile-fnparam.cc @@ -61,7 +61,7 @@ CompileFnParam::visit (HIR::IdentifierPattern &pattern) } void -CompileFnParam::visit (HIR::WildcardPattern &) +CompileFnParam::visit (HIR::WildcardPattern &pattern) { decl_type = ctx->get_backend ()->immutable_type (decl_type); diff --git a/gcc/rust/backend/rust-compile-implitem.h b/gcc/rust/backend/rust-compile-implitem.h index c786fba4489..ac9478af150 100644 --- a/gcc/rust/backend/rust-compile-implitem.h +++ b/gcc/rust/backend/rust-compile-implitem.h @@ -72,7 +72,7 @@ public: void visit (HIR::TraitItemConst &constant) override; void visit (HIR::TraitItemFunc &func) override; - void visit (HIR::TraitItemType &) override {} + void visit (HIR::TraitItemType &typ) override {} private: CompileTraitItem (Context *ctx, TyTy::BaseType *concrete, Location ref_locus) diff --git a/gcc/rust/backend/rust-compile-intrinsic.cc b/gcc/rust/backend/rust-compile-intrinsic.cc index 78eee530569..3bb9c618080 100644 --- a/gcc/rust/backend/rust-compile-intrinsic.cc +++ b/gcc/rust/backend/rust-compile-intrinsic.cc @@ -153,7 +153,7 @@ unchecked_op_handler (tree_code op) } inline tree -sorry_handler (Context *, TyTy::FnType *fntype) +sorry_handler (Context *ctx, TyTy::FnType *fntype) { rust_sorry_at (fntype->get_locus (), "intrinsic %qs is not yet implemented", fntype->get_identifier ().c_str ()); diff --git a/gcc/rust/backend/rust-compile-pattern.cc b/gcc/rust/backend/rust-compile-pattern.cc index 3f9d65095df..1d8eda1a577 100644 --- a/gcc/rust/backend/rust-compile-pattern.cc +++ b/gcc/rust/backend/rust-compile-pattern.cc @@ -71,7 +71,7 @@ CompilePatternCaseLabelExpr::visit (HIR::TupleStructPattern &pattern) } void -CompilePatternCaseLabelExpr::visit (HIR::WildcardPattern &) +CompilePatternCaseLabelExpr::visit (HIR::WildcardPattern &pattern) { // operand 0 being NULL_TREE signifies this is the default case label see: // tree.def for documentation for CASE_LABEL_EXPR diff --git a/gcc/rust/backend/rust-compile-resolve-path.cc b/gcc/rust/backend/rust-compile-resolve-path.cc index 7becdf79c40..f89da2bdcd5 100644 --- a/gcc/rust/backend/rust-compile-resolve-path.cc +++ b/gcc/rust/backend/rust-compile-resolve-path.cc @@ -33,20 +33,20 @@ void ResolvePathRef::visit (HIR::QualifiedPathInExpression &expr) { resolved = resolve (expr.get_final_segment ().get_segment (), - expr.get_mappings (), expr.get_locus ()); + expr.get_mappings (), expr.get_locus (), true); } void ResolvePathRef::visit (HIR::PathInExpression &expr) { resolved = resolve (expr.get_final_segment ().get_segment (), - expr.get_mappings (), expr.get_locus ()); + expr.get_mappings (), expr.get_locus (), false); } tree ResolvePathRef::resolve (const HIR::PathIdentSegment &final_segment, const Analysis::NodeMapping &mappings, - Location expr_locus) + Location expr_locus, bool is_qualified_path) { TyTy::BaseType *lookup = nullptr; bool ok = ctx->get_tyctx ()->lookup_type (mappings.get_hirid (), &lookup); @@ -157,8 +157,8 @@ ResolvePathRef::resolve (const HIR::PathIdentSegment &final_segment, } // let the query system figure it out - tree resolved_item - = query_compile (ref, lookup, final_segment, mappings, expr_locus); + tree resolved_item = query_compile (ref, lookup, final_segment, mappings, + expr_locus, is_qualified_path); if (resolved_item != error_mark_node) { TREE_USED (resolved_item) = 1; @@ -170,7 +170,7 @@ tree HIRCompileBase::query_compile (HirId ref, TyTy::BaseType *lookup, const HIR::PathIdentSegment &final_segment, const Analysis::NodeMapping &mappings, - Location expr_locus) + Location expr_locus, bool is_qualified_path) { HIR::Item *resolved_item = ctx->get_mappings ()->lookup_hir_item (ref); HirId parent_block; diff --git a/gcc/rust/backend/rust-compile-resolve-path.h b/gcc/rust/backend/rust-compile-resolve-path.h index 63441b61a62..f0360bdc739 100644 --- a/gcc/rust/backend/rust-compile-resolve-path.h +++ b/gcc/rust/backend/rust-compile-resolve-path.h @@ -61,7 +61,8 @@ public: {} tree resolve (const HIR::PathIdentSegment &final_segment, - const Analysis::NodeMapping &mappings, Location locus); + const Analysis::NodeMapping &mappings, Location locus, + bool is_qualified_path); tree resolved; }; diff --git a/gcc/rust/backend/rust-compile-type.cc b/gcc/rust/backend/rust-compile-type.cc index 8da283927e1..5e56e0a0b5d 100644 --- a/gcc/rust/backend/rust-compile-type.cc +++ b/gcc/rust/backend/rust-compile-type.cc @@ -399,7 +399,7 @@ TyTyResolveCompile::visit (const TyTy::SliceType &type) } void -TyTyResolveCompile::visit (const TyTy::BoolType &) +TyTyResolveCompile::visit (const TyTy::BoolType &type) { translated = ctx->get_backend ()->named_type ("bool", @@ -503,7 +503,7 @@ TyTyResolveCompile::visit (const TyTy::FloatType &type) } void -TyTyResolveCompile::visit (const TyTy::USizeType &) +TyTyResolveCompile::visit (const TyTy::USizeType &type) { translated = ctx->get_backend ()->named_type ( "usize", @@ -513,7 +513,7 @@ TyTyResolveCompile::visit (const TyTy::USizeType &) } void -TyTyResolveCompile::visit (const TyTy::ISizeType &) +TyTyResolveCompile::visit (const TyTy::ISizeType &type) { translated = ctx->get_backend ()->named_type ( "isize", @@ -523,7 +523,7 @@ TyTyResolveCompile::visit (const TyTy::ISizeType &) } void -TyTyResolveCompile::visit (const TyTy::CharType &) +TyTyResolveCompile::visit (const TyTy::CharType &type) { translated = ctx->get_backend ()->named_type ("char", diff --git a/gcc/rust/backend/rust-compile.cc b/gcc/rust/backend/rust-compile.cc index 1f97ad1b81e..0c72a167a70 100644 --- a/gcc/rust/backend/rust-compile.cc +++ b/gcc/rust/backend/rust-compile.cc @@ -214,7 +214,7 @@ HIRCompileBase::coerce_to_dyn_object (tree compiled_ref, auto address = compute_address_for_trait_item (item, predicate, probed_bounds_for_receiver, - actual, locus); + actual, actual, locus); vtable_ctor_elems.push_back (address); vtable_ctor_idx.push_back (i++); } @@ -233,7 +233,7 @@ HIRCompileBase::compute_address_for_trait_item ( const TyTy::TypeBoundPredicate *predicate, std::vector> &receiver_bounds, - const TyTy::BaseType *root, Location locus) + const TyTy::BaseType *receiver, const TyTy::BaseType *root, Location locus) { // There are two cases here one where its an item which has an implementation // within a trait-impl-block. Then there is the case where there is a default @@ -360,11 +360,9 @@ HIRCompileBase::compute_address_for_trait_item ( } bool -HIRCompileBase::verify_array_capacities ( - tree ltype, tree rtype, - // TODO: Reuse `lvalue_locus` when we want to switch to a RichLocation and - // point to the - Location /* lvalue_locus */, Location rvalue_locus) +HIRCompileBase::verify_array_capacities (tree ltype, tree rtype, + Location lvalue_locus, + Location rvalue_locus) { rust_assert (ltype != NULL_TREE); rust_assert (rtype != NULL_TREE); diff --git a/gcc/rust/backend/rust-constexpr.cc b/gcc/rust/backend/rust-constexpr.cc index 45861107236..21e8bed99b0 100644 --- a/gcc/rust/backend/rust-constexpr.cc +++ b/gcc/rust/backend/rust-constexpr.cc @@ -3996,7 +3996,8 @@ constexpr_fn_retval (const constexpr_ctx *ctx, tree body) // return an aggregate constant. If UNSHARE_P, return an unshared // copy of the initializer. static tree -constant_value_1 (tree decl, bool, bool, bool unshare_p) +constant_value_1 (tree decl, bool strict_p, bool return_aggregate_cst_ok_p, + bool unshare_p) { while (TREE_CODE (decl) == CONST_DECL) { @@ -6485,7 +6486,8 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now, /* Like maybe_constant_init but first fully instantiate the argument. */ tree -fold_non_dependent_init (tree t, tsubst_flags_t /*=tf_warning_or_error*/, +fold_non_dependent_init (tree t, + tsubst_flags_t complain /*=tf_warning_or_error*/, bool manifestly_const_eval /*=false*/, tree object /* = NULL_TREE */) { diff --git a/gcc/rust/backend/rust-tree.cc b/gcc/rust/backend/rust-tree.cc index fb6ff0f15b3..0c393d9635b 100644 --- a/gcc/rust/backend/rust-tree.cc +++ b/gcc/rust/backend/rust-tree.cc @@ -2059,7 +2059,11 @@ rs_tree_equal (tree t1, tree t2) /* TRUE iff TYPE is publicly & uniquely derived from PARENT. */ -bool publicly_uniquely_derived_p (tree, tree) { return false; } +bool +publicly_uniquely_derived_p (tree parent, tree type) +{ + return false; +} // forked from gcc/cp/typeck.cc comp_except_types @@ -3339,7 +3343,11 @@ release_tree_vector (vec *vec) /* As above, but also check value-dependence of the expression as a whole. */ -bool instantiation_dependent_expression_p (tree) { return false; } +bool +instantiation_dependent_expression_p (tree expression) +{ + return false; +} // forked from gcc/cp/cvt.cc cp_get_callee @@ -3389,7 +3397,11 @@ scalarish_type_p (const_tree t) constructors are deleted. This function implements the ABI notion of non-trivial copy, which has diverged from the one in the standard. */ -bool type_has_nontrivial_copy_init (const_tree) { return false; } +bool +type_has_nontrivial_copy_init (const_tree type) +{ + return false; +} // forked from gcc/cp/tree.cc build_local_temp @@ -3412,7 +3424,11 @@ build_local_temp (tree type) /* Returns true iff DECL is a capture proxy for a normal capture (i.e. without explicit initializer). */ -bool is_normal_capture_proxy (tree) { return false; } +bool +is_normal_capture_proxy (tree decl) +{ + return false; +} // forked from gcc/cp/c-common.cc reject_gcc_builtin @@ -3677,7 +3693,7 @@ char_type_p (tree type) lvalue for the function template specialization. */ tree -resolve_nondeduced_context (tree orig_expr, tsubst_flags_t) +resolve_nondeduced_context (tree orig_expr, tsubst_flags_t complain) { return orig_expr; } @@ -3956,13 +3972,21 @@ decl_constant_var_p (tree decl) /* Returns true iff DECL is a variable or function declared with an auto type that has not yet been deduced to a real type. */ -bool undeduced_auto_decl (tree) { return false; } +bool +undeduced_auto_decl (tree decl) +{ + return false; +} // forked from gcc/cp/decl.cc require_deduced_type /* Complain if DECL has an undeduced return type. */ -bool require_deduced_type (tree, tsubst_flags_t) { return true; } +bool +require_deduced_type (tree decl, tsubst_flags_t complain) +{ + return true; +} /* Return the location of a tree passed to %+ formats. */ diff --git a/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc b/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc index ae492a45be2..7d70203159a 100644 --- a/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc +++ b/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc @@ -226,7 +226,7 @@ PrivacyReporter::visit (HIR::PathInExpression &path) } void -PrivacyReporter::visit (HIR::TypePathSegmentFunction &) +PrivacyReporter::visit (HIR::TypePathSegmentFunction &segment) { // FIXME: Do we need to do anything for this? } @@ -253,7 +253,7 @@ PrivacyReporter::visit (HIR::QualifiedPathInType &path) } void -PrivacyReporter::visit (HIR::LiteralExpr &) +PrivacyReporter::visit (HIR::LiteralExpr &expr) { // Literals cannot contain any sort of privacy violation } @@ -371,13 +371,13 @@ PrivacyReporter::visit (HIR::TupleIndexExpr &expr) } void -PrivacyReporter::visit (HIR::StructExprStruct &) +PrivacyReporter::visit (HIR::StructExprStruct &expr) { // FIXME: We need to check the visibility of the type it refers to here } void -PrivacyReporter::visit (HIR::StructExprFieldIdentifier &) +PrivacyReporter::visit (HIR::StructExprFieldIdentifier &field) {} void @@ -426,7 +426,7 @@ PrivacyReporter::visit (HIR::FieldAccessExpr &expr) } void -PrivacyReporter::visit (HIR::ClosureExpr &) +PrivacyReporter::visit (HIR::ClosureExpr &expr) { // Not handled yet } @@ -443,7 +443,7 @@ PrivacyReporter::visit (HIR::BlockExpr &expr) } void -PrivacyReporter::visit (HIR::ContinueExpr &) +PrivacyReporter::visit (HIR::ContinueExpr &expr) {} void @@ -474,7 +474,7 @@ PrivacyReporter::visit (HIR::RangeToExpr &expr) } void -PrivacyReporter::visit (HIR::RangeFullExpr &) +PrivacyReporter::visit (HIR::RangeFullExpr &expr) {} void @@ -485,7 +485,7 @@ PrivacyReporter::visit (HIR::RangeFromToInclExpr &expr) } void -PrivacyReporter::visit (HIR::RangeToInclExpr &) +PrivacyReporter::visit (HIR::RangeToInclExpr &expr) { // Not handled yet } @@ -564,14 +564,14 @@ PrivacyReporter::visit (HIR::IfExprConseqIfLet &expr) } void -PrivacyReporter::visit (HIR::IfLetExpr &) +PrivacyReporter::visit (HIR::IfLetExpr &expr) { // TODO: We need to visit the if_let_expr // TODO: We need to visit the block as well } void -PrivacyReporter::visit (HIR::IfLetExprConseqElse &) +PrivacyReporter::visit (HIR::IfLetExprConseqElse &expr) { // TODO: We need to visit the if_let_expr // TODO: We need to visit the if_block as well @@ -579,7 +579,7 @@ PrivacyReporter::visit (HIR::IfLetExprConseqElse &) } void -PrivacyReporter::visit (HIR::IfLetExprConseqIf &) +PrivacyReporter::visit (HIR::IfLetExprConseqIf &expr) { // TODO: We need to visit the if_let_expr // TODO: We need to visit the if_block as well @@ -587,7 +587,7 @@ PrivacyReporter::visit (HIR::IfLetExprConseqIf &) } void -PrivacyReporter::visit (HIR::IfLetExprConseqIfLet &) +PrivacyReporter::visit (HIR::IfLetExprConseqIfLet &expr) { // TODO: We need to visit the if_let_expr // TODO: We need to visit the if_block as well @@ -601,13 +601,13 @@ PrivacyReporter::visit (HIR::MatchExpr &expr) } void -PrivacyReporter::visit (HIR::AwaitExpr &) +PrivacyReporter::visit (HIR::AwaitExpr &expr) { // Not handled yet } void -PrivacyReporter::visit (HIR::AsyncBlockExpr &) +PrivacyReporter::visit (HIR::AsyncBlockExpr &expr) { // Not handled yet } @@ -628,11 +628,11 @@ PrivacyReporter::visit (HIR::Module &module) } void -PrivacyReporter::visit (HIR::ExternCrate &) +PrivacyReporter::visit (HIR::ExternCrate &crate) {} void -PrivacyReporter::visit (HIR::UseDeclaration &) +PrivacyReporter::visit (HIR::UseDeclaration &use_decl) { // FIXME: Is there anything we need to do here? } @@ -647,51 +647,51 @@ PrivacyReporter::visit (HIR::Function &function) } void -PrivacyReporter::visit (HIR::TypeAlias &) +PrivacyReporter::visit (HIR::TypeAlias &type_alias) { // TODO: Check the type here } void -PrivacyReporter::visit (HIR::StructStruct &) +PrivacyReporter::visit (HIR::StructStruct &struct_item) { // TODO: Check the type of all fields } void -PrivacyReporter::visit (HIR::TupleStruct &) +PrivacyReporter::visit (HIR::TupleStruct &tuple_struct) { // TODO: Check the type of all fields } void -PrivacyReporter::visit (HIR::EnumItem &) +PrivacyReporter::visit (HIR::EnumItem &item) { // TODO: Check the type of all variants } void -PrivacyReporter::visit (HIR::EnumItemTuple &) +PrivacyReporter::visit (HIR::EnumItemTuple &item) { // TODO: Check the type } void -PrivacyReporter::visit (HIR::EnumItemStruct &) +PrivacyReporter::visit (HIR::EnumItemStruct &item) { // TODO: Check the type } void -PrivacyReporter::visit (HIR::EnumItemDiscriminant &) +PrivacyReporter::visit (HIR::EnumItemDiscriminant &item) {} void -PrivacyReporter::visit (HIR::Enum &) +PrivacyReporter::visit (HIR::Enum &enum_item) {} void -PrivacyReporter::visit (HIR::Union &) +PrivacyReporter::visit (HIR::Union &union_item) { // TODO: Check the type } @@ -711,7 +711,7 @@ PrivacyReporter::visit (HIR::StaticItem &static_item) } void -PrivacyReporter::visit (HIR::Trait &) +PrivacyReporter::visit (HIR::Trait &trait) { // FIXME: We need to be an ItemVisitor as well // for (auto &item : trait.get_trait_items ()) @@ -726,15 +726,15 @@ PrivacyReporter::visit (HIR::ImplBlock &impl) } void -PrivacyReporter::visit (HIR::ExternBlock &) +PrivacyReporter::visit (HIR::ExternBlock &block) { // FIXME: We need to be an ItemVisitor as well - // for (auto &block: block.get_extern_items ()) + // for (auto &item : block.get_extern_items ()) // item->accept_vis (*this); } void -PrivacyReporter::visit (HIR::EmptyStmt &) +PrivacyReporter::visit (HIR::EmptyStmt &stmt) {} void diff --git a/gcc/rust/checks/errors/privacy/rust-reachability.cc b/gcc/rust/checks/errors/privacy/rust-reachability.cc index 6d30813c97b..b322e29bfc3 100644 --- a/gcc/rust/checks/errors/privacy/rust-reachability.cc +++ b/gcc/rust/checks/errors/privacy/rust-reachability.cc @@ -140,7 +140,7 @@ ReachabilityVisitor::visit (HIR::StructStruct &struct_item) } void -ReachabilityVisitor::visit (HIR::TupleStruct &) +ReachabilityVisitor::visit (HIR::TupleStruct &tuple_struct) {} void @@ -227,7 +227,7 @@ ReachabilityVisitor::visit (HIR::ImplBlock &impl) } void -ReachabilityVisitor::visit (HIR::ExternBlock &) +ReachabilityVisitor::visit (HIR::ExternBlock &block) {} // FIXME: How can we visit Blocks in the current configuration? Have a full diff --git a/gcc/rust/checks/errors/privacy/rust-visibility-resolver.cc b/gcc/rust/checks/errors/privacy/rust-visibility-resolver.cc index 9472ff218b9..301182754a4 100644 --- a/gcc/rust/checks/errors/privacy/rust-visibility-resolver.cc +++ b/gcc/rust/checks/errors/privacy/rust-visibility-resolver.cc @@ -141,11 +141,11 @@ VisibilityResolver::visit (HIR::Module &mod) } void -VisibilityResolver::visit (HIR::ExternCrate &) +VisibilityResolver::visit (HIR::ExternCrate &crate) {} void -VisibilityResolver::visit (HIR::UseDeclaration &) +VisibilityResolver::visit (HIR::UseDeclaration &use_decl) {} void @@ -185,7 +185,7 @@ VisibilityResolver::visit (HIR::Enum &enum_item) } void -VisibilityResolver::visit (HIR::Union &) +VisibilityResolver::visit (HIR::Union &union_item) {} void @@ -238,7 +238,7 @@ VisibilityResolver::visit (HIR::ImplBlock &impl) } void -VisibilityResolver::visit (HIR::ExternBlock &) +VisibilityResolver::visit (HIR::ExternBlock &block) {} } // namespace Privacy diff --git a/gcc/rust/checks/errors/rust-const-checker.cc b/gcc/rust/checks/errors/rust-const-checker.cc index 3de27ec134b..3254a982b91 100644 --- a/gcc/rust/checks/errors/rust-const-checker.cc +++ b/gcc/rust/checks/errors/rust-const-checker.cc @@ -114,43 +114,43 @@ ConstChecker::check_default_const_generics ( } void -ConstChecker::visit (Lifetime &) +ConstChecker::visit (Lifetime &lifetime) {} void -ConstChecker::visit (LifetimeParam &) +ConstChecker::visit (LifetimeParam &lifetime_param) {} void -ConstChecker::visit (PathInExpression &) +ConstChecker::visit (PathInExpression &path) {} void -ConstChecker::visit (TypePathSegment &) +ConstChecker::visit (TypePathSegment &segment) {} void -ConstChecker::visit (TypePathSegmentGeneric &) +ConstChecker::visit (TypePathSegmentGeneric &segment) {} void -ConstChecker::visit (TypePathSegmentFunction &) +ConstChecker::visit (TypePathSegmentFunction &segment) {} void -ConstChecker::visit (TypePath &) +ConstChecker::visit (TypePath &path) {} void -ConstChecker::visit (QualifiedPathInExpression &) +ConstChecker::visit (QualifiedPathInExpression &path) {} void -ConstChecker::visit (QualifiedPathInType &) +ConstChecker::visit (QualifiedPathInType &path) {} void -ConstChecker::visit (LiteralExpr &) +ConstChecker::visit (LiteralExpr &expr) {} void @@ -270,11 +270,11 @@ ConstChecker::visit (TupleIndexExpr &expr) } void -ConstChecker::visit (StructExprStruct &) +ConstChecker::visit (StructExprStruct &expr) {} void -ConstChecker::visit (StructExprFieldIdentifier &) +ConstChecker::visit (StructExprFieldIdentifier &field) {} void @@ -297,7 +297,7 @@ ConstChecker::visit (StructExprStructFields &expr) } void -ConstChecker::visit (StructExprStructBase &) +ConstChecker::visit (StructExprStructBase &expr) {} void @@ -398,7 +398,7 @@ ConstChecker::visit (BlockExpr &expr) } void -ConstChecker::visit (ContinueExpr &) +ConstChecker::visit (ContinueExpr &expr) {} void @@ -428,7 +428,7 @@ ConstChecker::visit (RangeToExpr &expr) } void -ConstChecker::visit (RangeFullExpr &) +ConstChecker::visit (RangeFullExpr &expr) {} void @@ -439,7 +439,7 @@ ConstChecker::visit (RangeFromToInclExpr &expr) } void -ConstChecker::visit (RangeToInclExpr &) +ConstChecker::visit (RangeToInclExpr &expr) { // FIXME: Visit to_expr } @@ -558,31 +558,31 @@ ConstChecker::visit (MatchExpr &expr) } void -ConstChecker::visit (AwaitExpr &) +ConstChecker::visit (AwaitExpr &expr) { // TODO: Visit expression } void -ConstChecker::visit (AsyncBlockExpr &) +ConstChecker::visit (AsyncBlockExpr &expr) { // TODO: Visit block expression } void -ConstChecker::visit (TypeParam &) +ConstChecker::visit (TypeParam ¶m) {} void -ConstChecker::visit (ConstGenericParam &) +ConstChecker::visit (ConstGenericParam ¶m) {} void -ConstChecker::visit (LifetimeWhereClauseItem &) +ConstChecker::visit (LifetimeWhereClauseItem &item) {} void -ConstChecker::visit (TypeBoundWhereClauseItem &) +ConstChecker::visit (TypeBoundWhereClauseItem &item) {} void @@ -593,23 +593,23 @@ ConstChecker::visit (Module &module) } void -ConstChecker::visit (ExternCrate &) +ConstChecker::visit (ExternCrate &crate) {} void -ConstChecker::visit (UseTreeGlob &) +ConstChecker::visit (UseTreeGlob &use_tree) {} void -ConstChecker::visit (UseTreeList &) +ConstChecker::visit (UseTreeList &use_tree) {} void -ConstChecker::visit (UseTreeRebind &) +ConstChecker::visit (UseTreeRebind &use_tree) {} void -ConstChecker::visit (UseDeclaration &) +ConstChecker::visit (UseDeclaration &use_decl) {} void @@ -653,15 +653,15 @@ ConstChecker::visit (TupleStruct &tuple_struct) } void -ConstChecker::visit (EnumItem &) +ConstChecker::visit (EnumItem &enum_item) {} void -ConstChecker::visit (EnumItemTuple &) +ConstChecker::visit (EnumItemTuple &item) {} void -ConstChecker::visit (EnumItemStruct &) +ConstChecker::visit (EnumItemStruct &item) {} void @@ -723,7 +723,7 @@ ConstChecker::visit (TraitItemConst &item) } void -ConstChecker::visit (TraitItemType &) +ConstChecker::visit (TraitItemType &item) {} void @@ -747,11 +747,11 @@ ConstChecker::visit (ImplBlock &impl) } void -ConstChecker::visit (ExternalStaticItem &) +ConstChecker::visit (ExternalStaticItem &item) {} void -ConstChecker::visit (ExternalFunctionItem &) +ConstChecker::visit (ExternalFunctionItem &item) {} void @@ -763,87 +763,87 @@ ConstChecker::visit (ExternBlock &block) } void -ConstChecker::visit (LiteralPattern &) +ConstChecker::visit (LiteralPattern &pattern) {} void -ConstChecker::visit (IdentifierPattern &) +ConstChecker::visit (IdentifierPattern &pattern) {} void -ConstChecker::visit (WildcardPattern &) +ConstChecker::visit (WildcardPattern &pattern) {} void -ConstChecker::visit (RangePatternBoundLiteral &) +ConstChecker::visit (RangePatternBoundLiteral &bound) {} void -ConstChecker::visit (RangePatternBoundPath &) +ConstChecker::visit (RangePatternBoundPath &bound) {} void -ConstChecker::visit (RangePatternBoundQualPath &) +ConstChecker::visit (RangePatternBoundQualPath &bound) {} void -ConstChecker::visit (RangePattern &) +ConstChecker::visit (RangePattern &pattern) {} void -ConstChecker::visit (ReferencePattern &) +ConstChecker::visit (ReferencePattern &pattern) {} void -ConstChecker::visit (StructPatternFieldTuplePat &) +ConstChecker::visit (StructPatternFieldTuplePat &field) {} void -ConstChecker::visit (StructPatternFieldIdentPat &) +ConstChecker::visit (StructPatternFieldIdentPat &field) {} void -ConstChecker::visit (StructPatternFieldIdent &) +ConstChecker::visit (StructPatternFieldIdent &field) {} void -ConstChecker::visit (StructPattern &) +ConstChecker::visit (StructPattern &pattern) {} void -ConstChecker::visit (TupleStructItemsNoRange &) +ConstChecker::visit (TupleStructItemsNoRange &tuple_items) {} void -ConstChecker::visit (TupleStructItemsRange &) +ConstChecker::visit (TupleStructItemsRange &tuple_items) {} void -ConstChecker::visit (TupleStructPattern &) +ConstChecker::visit (TupleStructPattern &pattern) {} void -ConstChecker::visit (TuplePatternItemsMultiple &) +ConstChecker::visit (TuplePatternItemsMultiple &tuple_items) {} void -ConstChecker::visit (TuplePatternItemsRanged &) +ConstChecker::visit (TuplePatternItemsRanged &tuple_items) {} void -ConstChecker::visit (TuplePattern &) +ConstChecker::visit (TuplePattern &pattern) {} void -ConstChecker::visit (GroupedPattern &) +ConstChecker::visit (GroupedPattern &pattern) {} void -ConstChecker::visit (SlicePattern &) +ConstChecker::visit (SlicePattern &pattern) {} void -ConstChecker::visit (EmptyStmt &) +ConstChecker::visit (EmptyStmt &stmt) {} void @@ -866,39 +866,39 @@ ConstChecker::visit (ExprStmtWithBlock &stmt) } void -ConstChecker::visit (TraitBound &) +ConstChecker::visit (TraitBound &bound) {} void -ConstChecker::visit (ImplTraitType &) +ConstChecker::visit (ImplTraitType &type) {} void -ConstChecker::visit (TraitObjectType &) +ConstChecker::visit (TraitObjectType &type) {} void -ConstChecker::visit (ParenthesisedType &) +ConstChecker::visit (ParenthesisedType &type) {} void -ConstChecker::visit (ImplTraitTypeOneBound &) +ConstChecker::visit (ImplTraitTypeOneBound &type) {} void -ConstChecker::visit (TupleType &) +ConstChecker::visit (TupleType &type) {} void -ConstChecker::visit (NeverType &) +ConstChecker::visit (NeverType &type) {} void -ConstChecker::visit (RawPointerType &) +ConstChecker::visit (RawPointerType &type) {} void -ConstChecker::visit (ReferenceType &) +ConstChecker::visit (ReferenceType &type) {} void @@ -912,15 +912,15 @@ ConstChecker::visit (ArrayType &type) } void -ConstChecker::visit (SliceType &) +ConstChecker::visit (SliceType &type) {} void -ConstChecker::visit (InferredType &) +ConstChecker::visit (InferredType &type) {} void -ConstChecker::visit (BareFunctionType &) +ConstChecker::visit (BareFunctionType &type) {} } // namespace HIR diff --git a/gcc/rust/checks/errors/rust-unsafe-checker.cc b/gcc/rust/checks/errors/rust-unsafe-checker.cc index 82bde0ecb33..55a21590b2e 100644 --- a/gcc/rust/checks/errors/rust-unsafe-checker.cc +++ b/gcc/rust/checks/errors/rust-unsafe-checker.cc @@ -180,11 +180,11 @@ UnsafeChecker::check_function_call (HirId node_id, Location locus) } void -UnsafeChecker::visit (Lifetime &) +UnsafeChecker::visit (Lifetime &lifetime) {} void -UnsafeChecker::visit (LifetimeParam &) +UnsafeChecker::visit (LifetimeParam &lifetime_param) {} void @@ -203,31 +203,31 @@ UnsafeChecker::visit (PathInExpression &path) } void -UnsafeChecker::visit (TypePathSegment &) +UnsafeChecker::visit (TypePathSegment &segment) {} void -UnsafeChecker::visit (TypePathSegmentGeneric &) +UnsafeChecker::visit (TypePathSegmentGeneric &segment) {} void -UnsafeChecker::visit (TypePathSegmentFunction &) +UnsafeChecker::visit (TypePathSegmentFunction &segment) {} void -UnsafeChecker::visit (TypePath &) +UnsafeChecker::visit (TypePath &path) {} void -UnsafeChecker::visit (QualifiedPathInExpression &) +UnsafeChecker::visit (QualifiedPathInExpression &path) {} void -UnsafeChecker::visit (QualifiedPathInType &) +UnsafeChecker::visit (QualifiedPathInType &path) {} void -UnsafeChecker::visit (LiteralExpr &) +UnsafeChecker::visit (LiteralExpr &expr) {} void @@ -349,11 +349,11 @@ UnsafeChecker::visit (TupleIndexExpr &expr) } void -UnsafeChecker::visit (StructExprStruct &) +UnsafeChecker::visit (StructExprStruct &expr) {} void -UnsafeChecker::visit (StructExprFieldIdentifier &) +UnsafeChecker::visit (StructExprFieldIdentifier &field) {} void @@ -376,7 +376,7 @@ UnsafeChecker::visit (StructExprStructFields &expr) } void -UnsafeChecker::visit (StructExprStructBase &) +UnsafeChecker::visit (StructExprStructBase &expr) {} void @@ -469,7 +469,7 @@ UnsafeChecker::visit (BlockExpr &expr) } void -UnsafeChecker::visit (ContinueExpr &) +UnsafeChecker::visit (ContinueExpr &expr) {} void @@ -499,7 +499,7 @@ UnsafeChecker::visit (RangeToExpr &expr) } void -UnsafeChecker::visit (RangeFullExpr &) +UnsafeChecker::visit (RangeFullExpr &expr) {} void @@ -633,31 +633,31 @@ UnsafeChecker::visit (MatchExpr &expr) } void -UnsafeChecker::visit (AwaitExpr &) +UnsafeChecker::visit (AwaitExpr &expr) { // TODO: Visit expression } void -UnsafeChecker::visit (AsyncBlockExpr &) +UnsafeChecker::visit (AsyncBlockExpr &expr) { // TODO: Visit block expression } void -UnsafeChecker::visit (TypeParam &) +UnsafeChecker::visit (TypeParam ¶m) {} void -UnsafeChecker::visit (ConstGenericParam &) +UnsafeChecker::visit (ConstGenericParam ¶m) {} void -UnsafeChecker::visit (LifetimeWhereClauseItem &) +UnsafeChecker::visit (LifetimeWhereClauseItem &item) {} void -UnsafeChecker::visit (TypeBoundWhereClauseItem &) +UnsafeChecker::visit (TypeBoundWhereClauseItem &item) {} void @@ -668,23 +668,23 @@ UnsafeChecker::visit (Module &module) } void -UnsafeChecker::visit (ExternCrate &) +UnsafeChecker::visit (ExternCrate &crate) {} void -UnsafeChecker::visit (UseTreeGlob &) +UnsafeChecker::visit (UseTreeGlob &use_tree) {} void -UnsafeChecker::visit (UseTreeList &) +UnsafeChecker::visit (UseTreeList &use_tree) {} void -UnsafeChecker::visit (UseTreeRebind &) +UnsafeChecker::visit (UseTreeRebind &use_tree) {} void -UnsafeChecker::visit (UseDeclaration &) +UnsafeChecker::visit (UseDeclaration &use_decl) {} void @@ -702,42 +702,42 @@ UnsafeChecker::visit (Function &function) } void -UnsafeChecker::visit (TypeAlias &) +UnsafeChecker::visit (TypeAlias &type_alias) { // FIXME: What do we need to do to handle type aliasing? Is it possible to // have unsafe types? Type aliases on unsafe functions? } void -UnsafeChecker::visit (StructStruct &) +UnsafeChecker::visit (StructStruct &struct_item) {} void -UnsafeChecker::visit (TupleStruct &) +UnsafeChecker::visit (TupleStruct &tuple_struct) {} void -UnsafeChecker::visit (EnumItem &) +UnsafeChecker::visit (EnumItem &item) {} void -UnsafeChecker::visit (EnumItemTuple &) +UnsafeChecker::visit (EnumItemTuple &item) {} void -UnsafeChecker::visit (EnumItemStruct &) +UnsafeChecker::visit (EnumItemStruct &item) {} void -UnsafeChecker::visit (EnumItemDiscriminant &) +UnsafeChecker::visit (EnumItemDiscriminant &item) {} void -UnsafeChecker::visit (Enum &) +UnsafeChecker::visit (Enum &enum_item) {} void -UnsafeChecker::visit (Union &) +UnsafeChecker::visit (Union &union_item) {} void @@ -767,7 +767,7 @@ UnsafeChecker::visit (TraitItemConst &item) } void -UnsafeChecker::visit (TraitItemType &) +UnsafeChecker::visit (TraitItemType &item) {} void @@ -787,11 +787,11 @@ UnsafeChecker::visit (ImplBlock &impl) } void -UnsafeChecker::visit (ExternalStaticItem &) +UnsafeChecker::visit (ExternalStaticItem &item) {} void -UnsafeChecker::visit (ExternalFunctionItem &) +UnsafeChecker::visit (ExternalFunctionItem &item) {} void @@ -803,87 +803,87 @@ UnsafeChecker::visit (ExternBlock &block) } void -UnsafeChecker::visit (LiteralPattern &) +UnsafeChecker::visit (LiteralPattern &pattern) {} void -UnsafeChecker::visit (IdentifierPattern &) +UnsafeChecker::visit (IdentifierPattern &pattern) {} void -UnsafeChecker::visit (WildcardPattern &) +UnsafeChecker::visit (WildcardPattern &pattern) {} void -UnsafeChecker::visit (RangePatternBoundLiteral &) +UnsafeChecker::visit (RangePatternBoundLiteral &bound) {} void -UnsafeChecker::visit (RangePatternBoundPath &) +UnsafeChecker::visit (RangePatternBoundPath &bound) {} void -UnsafeChecker::visit (RangePatternBoundQualPath &) +UnsafeChecker::visit (RangePatternBoundQualPath &bound) {} void -UnsafeChecker::visit (RangePattern &) +UnsafeChecker::visit (RangePattern &pattern) {} void -UnsafeChecker::visit (ReferencePattern &) +UnsafeChecker::visit (ReferencePattern &pattern) {} void -UnsafeChecker::visit (StructPatternFieldTuplePat &) +UnsafeChecker::visit (StructPatternFieldTuplePat &field) {} void -UnsafeChecker::visit (StructPatternFieldIdentPat &) +UnsafeChecker::visit (StructPatternFieldIdentPat &field) {} void -UnsafeChecker::visit (StructPatternFieldIdent &) +UnsafeChecker::visit (StructPatternFieldIdent &field) {} void -UnsafeChecker::visit (StructPattern &) +UnsafeChecker::visit (StructPattern &pattern) {} void -UnsafeChecker::visit (TupleStructItemsNoRange &) +UnsafeChecker::visit (TupleStructItemsNoRange &tuple_items) {} void -UnsafeChecker::visit (TupleStructItemsRange &) +UnsafeChecker::visit (TupleStructItemsRange &tuple_items) {} void -UnsafeChecker::visit (TupleStructPattern &) +UnsafeChecker::visit (TupleStructPattern &pattern) {} void -UnsafeChecker::visit (TuplePatternItemsMultiple &) +UnsafeChecker::visit (TuplePatternItemsMultiple &tuple_items) {} void -UnsafeChecker::visit (TuplePatternItemsRanged &) +UnsafeChecker::visit (TuplePatternItemsRanged &tuple_items) {} void -UnsafeChecker::visit (TuplePattern &) +UnsafeChecker::visit (TuplePattern &pattern) {} void -UnsafeChecker::visit (GroupedPattern &) +UnsafeChecker::visit (GroupedPattern &pattern) {} void -UnsafeChecker::visit (SlicePattern &) +UnsafeChecker::visit (SlicePattern &pattern) {} void -UnsafeChecker::visit (EmptyStmt &) +UnsafeChecker::visit (EmptyStmt &stmt) {} void @@ -906,55 +906,55 @@ UnsafeChecker::visit (ExprStmtWithBlock &stmt) } void -UnsafeChecker::visit (TraitBound &) +UnsafeChecker::visit (TraitBound &bound) {} void -UnsafeChecker::visit (ImplTraitType &) +UnsafeChecker::visit (ImplTraitType &type) {} void -UnsafeChecker::visit (TraitObjectType &) +UnsafeChecker::visit (TraitObjectType &type) {} void -UnsafeChecker::visit (ParenthesisedType &) +UnsafeChecker::visit (ParenthesisedType &type) {} void -UnsafeChecker::visit (ImplTraitTypeOneBound &) +UnsafeChecker::visit (ImplTraitTypeOneBound &type) {} void -UnsafeChecker::visit (TupleType &) +UnsafeChecker::visit (TupleType &type) {} void -UnsafeChecker::visit (NeverType &) +UnsafeChecker::visit (NeverType &type) {} void -UnsafeChecker::visit (RawPointerType &) +UnsafeChecker::visit (RawPointerType &type) {} void -UnsafeChecker::visit (ReferenceType &) +UnsafeChecker::visit (ReferenceType &type) {} void -UnsafeChecker::visit (ArrayType &) +UnsafeChecker::visit (ArrayType &type) {} void -UnsafeChecker::visit (SliceType &) +UnsafeChecker::visit (SliceType &type) {} void -UnsafeChecker::visit (InferredType &) +UnsafeChecker::visit (InferredType &type) {} void -UnsafeChecker::visit (BareFunctionType &) +UnsafeChecker::visit (BareFunctionType &type) {} } // namespace HIR diff --git a/gcc/rust/checks/lints/rust-lint-marklive.cc b/gcc/rust/checks/lints/rust-lint-marklive.cc index 26b3dee99c7..19fbeb9ec9f 100644 --- a/gcc/rust/checks/lints/rust-lint-marklive.cc +++ b/gcc/rust/checks/lints/rust-lint-marklive.cc @@ -78,7 +78,7 @@ MarkLive::Analysis (HIR::Crate &crate) // visited first time // 2. save all the live symbols in liveSymbols void -MarkLive::go (HIR::Crate &) +MarkLive::go (HIR::Crate &crate) { while (!worklist.empty ()) { diff --git a/gcc/rust/checks/lints/rust-lint-unused-var.cc b/gcc/rust/checks/lints/rust-lint-unused-var.cc index 6332444e320..d4317e53280 100644 --- a/gcc/rust/checks/lints/rust-lint-unused-var.cc +++ b/gcc/rust/checks/lints/rust-lint-unused-var.cc @@ -53,7 +53,7 @@ check_decl (tree *t) } static tree -unused_var_walk_fn (tree *t, int *, void *) +unused_var_walk_fn (tree *t, int *walk_subtrees, void *closure) { switch (TREE_CODE (*t)) { diff --git a/gcc/rust/expand/rust-macro-builtins.cc b/gcc/rust/expand/rust-macro-builtins.cc index f6ddb1a803e..a00b5edca5f 100644 --- a/gcc/rust/expand/rust-macro-builtins.cc +++ b/gcc/rust/expand/rust-macro-builtins.cc @@ -99,6 +99,7 @@ try_extract_string_literal_from_fragment (const Location &parent_locus, static std::unique_ptr try_expand_single_string_literal (AST::Expr *input_expr, + const Location &invoc_locus, MacroExpander *expander) { auto nodes = try_expand_macro_expression (input_expr, expander); @@ -115,8 +116,8 @@ try_expand_single_string_literal (AST::Expr *input_expr, static std::vector> try_expand_many_expr (Parser &parser, - const TokenId last_token_id, MacroExpander *expander, - bool &has_error) + const Location &invoc_locus, const TokenId last_token_id, + MacroExpander *expander, bool &has_error) { auto restrictions = Rust::ParseRestrictions (); // stop parsing when encountered a braces/brackets @@ -203,7 +204,8 @@ parse_single_string_literal (AST::DelimTokenTree &invoc_token_tree, // when the expression does not seem to be a string literal, we then try // to parse/expand it as macro to see if it expands to a string literal auto expr = parser.parse_expr (); - lit_expr = try_expand_single_string_literal (expr.get (), expander); + lit_expr + = try_expand_single_string_literal (expr.get (), invoc_locus, expander); } parser.skip_token (last_token_id); @@ -263,7 +265,7 @@ load_file_bytes (const char *filename) } // namespace AST::Fragment -MacroBuiltin::assert_handler (Location, AST::MacroInvocData &) +MacroBuiltin::assert_handler (Location invoc_locus, AST::MacroInvocData &invoc) { rust_debug ("assert!() called"); @@ -271,7 +273,7 @@ MacroBuiltin::assert_handler (Location, AST::MacroInvocData &) } AST::Fragment -MacroBuiltin::file_handler (Location invoc_locus, AST::MacroInvocData &) +MacroBuiltin::file_handler (Location invoc_locus, AST::MacroInvocData &invoc) { auto current_file = Session::get_instance ().linemap->location_file (invoc_locus); @@ -281,7 +283,7 @@ MacroBuiltin::file_handler (Location invoc_locus, AST::MacroInvocData &) } AST::Fragment -MacroBuiltin::column_handler (Location invoc_locus, AST::MacroInvocData &) +MacroBuiltin::column_handler (Location invoc_locus, AST::MacroInvocData &invoc) { auto current_column = Session::get_instance ().linemap->location_to_column (invoc_locus); @@ -399,7 +401,7 @@ MacroBuiltin::concat_handler (Location invoc_locus, AST::MacroInvocData &invoc) auto last_token_id = macro_end_token (invoc_token_tree, parser); /* NOTE: concat! could accept no argument, so we don't have any checks here */ - auto expanded_expr = try_expand_many_expr (parser, last_token_id, + auto expanded_expr = try_expand_many_expr (parser, invoc_locus, last_token_id, invoc.get_expander (), has_error); for (auto &expr : expanded_expr) { @@ -449,7 +451,7 @@ MacroBuiltin::env_handler (Location invoc_locus, AST::MacroInvocData &invoc) std::unique_ptr lit_expr = nullptr; bool has_error = false; - auto expanded_expr = try_expand_many_expr (parser, last_token_id, + auto expanded_expr = try_expand_many_expr (parser, invoc_locus, last_token_id, invoc.get_expander (), has_error); if (has_error) return AST::Fragment::create_error (); @@ -589,7 +591,7 @@ MacroBuiltin::include_handler (Location invoc_locus, AST::MacroInvocData &invoc) } AST::Fragment -MacroBuiltin::line_handler (Location invoc_locus, AST::MacroInvocData &) +MacroBuiltin::line_handler (Location invoc_locus, AST::MacroInvocData &invoc) { auto current_line = Session::get_instance ().linemap->location_to_line (invoc_locus); diff --git a/gcc/rust/hir/rust-ast-lower-base.cc b/gcc/rust/hir/rust-ast-lower-base.cc index 86130b5562e..592d9e810f9 100644 --- a/gcc/rust/hir/rust-ast-lower-base.cc +++ b/gcc/rust/hir/rust-ast-lower-base.cc @@ -25,499 +25,499 @@ namespace Rust { namespace HIR { void -ASTLoweringBase::visit (AST::Token &) +ASTLoweringBase::visit (AST::Token &tok) {} void -ASTLoweringBase::visit (AST::DelimTokenTree &) +ASTLoweringBase::visit (AST::DelimTokenTree &delim_tok_tree) {} void -ASTLoweringBase::visit (AST::AttrInputMetaItemContainer &) +ASTLoweringBase::visit (AST::AttrInputMetaItemContainer &input) {} -// void ASTLoweringBase::visit(MetaItemmeta_item) {} -// void vsit(Stmtstmt) {} -// void ASTLoweringBase::visit(Exprexpr) {} +// void ASTLoweringBase::visit(MetaItem& meta_item) {} +// void vsit(Stmt& stmt) {} +// void ASTLoweringBase::visit(Expr& expr) {} void -ASTLoweringBase::visit (AST::IdentifierExpr &) +ASTLoweringBase::visit (AST::IdentifierExpr &ident_expr) {} -// void ASTLoweringBase::visit(Patternpattern) {} -// void ASTLoweringBase::visit(Typetype) {} -// void ASTLoweringBase::visit(TypeParamBoundtype_param_bound) {} +// void ASTLoweringBase::visit(Pattern& pattern) {} +// void ASTLoweringBase::visit(Type& type) {} +// void ASTLoweringBase::visit(TypeParamBound& type_param_bound) {} void -ASTLoweringBase::visit (AST::Lifetime &) +ASTLoweringBase::visit (AST::Lifetime &lifetime) {} -// void ASTLoweringBase::visit(GenericParamgeneric_param) {} +// void ASTLoweringBase::visit(GenericParam& generic_param) {} void -ASTLoweringBase::visit (AST::LifetimeParam &) +ASTLoweringBase::visit (AST::LifetimeParam &lifetime_param) {} void -ASTLoweringBase::visit (AST::ConstGenericParam &) +ASTLoweringBase::visit (AST::ConstGenericParam &const_param) {} -// void ASTLoweringBase::visit(TraitItemtrait_item) {} -// void ASTLoweringBase::visit(InherentImplIteminherent_impl_item) {} -// void ASTLoweringBase::visit(TraitImplItemtrait_impl_item) {} +// void ASTLoweringBase::visit(TraitItem& trait_item) {} +// void ASTLoweringBase::visit(InherentImplItem& inherent_impl_item) {} +// void ASTLoweringBase::visit(TraitImplItem& trait_impl_item) {} // rust-path.h void -ASTLoweringBase::visit (AST::PathInExpression &) +ASTLoweringBase::visit (AST::PathInExpression &path) {} void -ASTLoweringBase::visit (AST::TypePathSegment &) +ASTLoweringBase::visit (AST::TypePathSegment &segment) {} void -ASTLoweringBase::visit (AST::TypePathSegmentGeneric &) +ASTLoweringBase::visit (AST::TypePathSegmentGeneric &segment) {} void -ASTLoweringBase::visit (AST::TypePathSegmentFunction &) +ASTLoweringBase::visit (AST::TypePathSegmentFunction &segment) {} void -ASTLoweringBase::visit (AST::TypePath &) +ASTLoweringBase::visit (AST::TypePath &path) {} void -ASTLoweringBase::visit (AST::QualifiedPathInExpression &) +ASTLoweringBase::visit (AST::QualifiedPathInExpression &path) {} void -ASTLoweringBase::visit (AST::QualifiedPathInType &) +ASTLoweringBase::visit (AST::QualifiedPathInType &path) {} // rust-expr.h void -ASTLoweringBase::visit (AST::LiteralExpr &) +ASTLoweringBase::visit (AST::LiteralExpr &expr) {} void -ASTLoweringBase::visit (AST::AttrInputLiteral &) +ASTLoweringBase::visit (AST::AttrInputLiteral &attr_input) {} void -ASTLoweringBase::visit (AST::MetaItemLitExpr &) +ASTLoweringBase::visit (AST::MetaItemLitExpr &meta_item) {} void -ASTLoweringBase::visit (AST::MetaItemPathLit &) +ASTLoweringBase::visit (AST::MetaItemPathLit &meta_item) {} void -ASTLoweringBase::visit (AST::BorrowExpr &) +ASTLoweringBase::visit (AST::BorrowExpr &expr) {} void -ASTLoweringBase::visit (AST::DereferenceExpr &) +ASTLoweringBase::visit (AST::DereferenceExpr &expr) {} void -ASTLoweringBase::visit (AST::ErrorPropagationExpr &) +ASTLoweringBase::visit (AST::ErrorPropagationExpr &expr) {} void -ASTLoweringBase::visit (AST::NegationExpr &) +ASTLoweringBase::visit (AST::NegationExpr &expr) {} void -ASTLoweringBase::visit (AST::ArithmeticOrLogicalExpr &) +ASTLoweringBase::visit (AST::ArithmeticOrLogicalExpr &expr) {} void -ASTLoweringBase::visit (AST::ComparisonExpr &) +ASTLoweringBase::visit (AST::ComparisonExpr &expr) {} void -ASTLoweringBase::visit (AST::LazyBooleanExpr &) +ASTLoweringBase::visit (AST::LazyBooleanExpr &expr) {} void -ASTLoweringBase::visit (AST::TypeCastExpr &) +ASTLoweringBase::visit (AST::TypeCastExpr &expr) {} void -ASTLoweringBase::visit (AST::AssignmentExpr &) +ASTLoweringBase::visit (AST::AssignmentExpr &expr) {} void -ASTLoweringBase::visit (AST::CompoundAssignmentExpr &) +ASTLoweringBase::visit (AST::CompoundAssignmentExpr &expr) {} void -ASTLoweringBase::visit (AST::GroupedExpr &) +ASTLoweringBase::visit (AST::GroupedExpr &expr) {} -// void ASTLoweringBase::visit(ArrayElemselems) {} +// void ASTLoweringBase::visit(ArrayElems& elems) {} void -ASTLoweringBase::visit (AST::ArrayElemsValues &) +ASTLoweringBase::visit (AST::ArrayElemsValues &elems) {} void -ASTLoweringBase::visit (AST::ArrayElemsCopied &) +ASTLoweringBase::visit (AST::ArrayElemsCopied &elems) {} void -ASTLoweringBase::visit (AST::ArrayExpr &) +ASTLoweringBase::visit (AST::ArrayExpr &expr) {} void -ASTLoweringBase::visit (AST::ArrayIndexExpr &) +ASTLoweringBase::visit (AST::ArrayIndexExpr &expr) {} void -ASTLoweringBase::visit (AST::TupleExpr &) +ASTLoweringBase::visit (AST::TupleExpr &expr) {} void -ASTLoweringBase::visit (AST::TupleIndexExpr &) +ASTLoweringBase::visit (AST::TupleIndexExpr &expr) {} void -ASTLoweringBase::visit (AST::StructExprStruct &) +ASTLoweringBase::visit (AST::StructExprStruct &expr) {} -// void ASTLoweringBase::visit(StructExprFieldfield) {} +// void ASTLoweringBase::visit(StructExprField& field) {} void -ASTLoweringBase::visit (AST::StructExprFieldIdentifier &) +ASTLoweringBase::visit (AST::StructExprFieldIdentifier &field) {} void -ASTLoweringBase::visit (AST::StructExprFieldIdentifierValue &) +ASTLoweringBase::visit (AST::StructExprFieldIdentifierValue &field) {} void -ASTLoweringBase::visit (AST::StructExprFieldIndexValue &) +ASTLoweringBase::visit (AST::StructExprFieldIndexValue &field) {} void -ASTLoweringBase::visit (AST::StructExprStructFields &) +ASTLoweringBase::visit (AST::StructExprStructFields &expr) {} void -ASTLoweringBase::visit (AST::StructExprStructBase &) +ASTLoweringBase::visit (AST::StructExprStructBase &expr) {} void -ASTLoweringBase::visit (AST::CallExpr &) +ASTLoweringBase::visit (AST::CallExpr &expr) {} void -ASTLoweringBase::visit (AST::MethodCallExpr &) +ASTLoweringBase::visit (AST::MethodCallExpr &expr) {} void -ASTLoweringBase::visit (AST::FieldAccessExpr &) +ASTLoweringBase::visit (AST::FieldAccessExpr &expr) {} void -ASTLoweringBase::visit (AST::ClosureExprInner &) +ASTLoweringBase::visit (AST::ClosureExprInner &expr) {} void -ASTLoweringBase::visit (AST::BlockExpr &) +ASTLoweringBase::visit (AST::BlockExpr &expr) {} void -ASTLoweringBase::visit (AST::ClosureExprInnerTyped &) +ASTLoweringBase::visit (AST::ClosureExprInnerTyped &expr) {} void -ASTLoweringBase::visit (AST::ContinueExpr &) +ASTLoweringBase::visit (AST::ContinueExpr &expr) {} void -ASTLoweringBase::visit (AST::BreakExpr &) +ASTLoweringBase::visit (AST::BreakExpr &expr) {} void -ASTLoweringBase::visit (AST::RangeFromToExpr &) +ASTLoweringBase::visit (AST::RangeFromToExpr &expr) {} void -ASTLoweringBase::visit (AST::RangeFromExpr &) +ASTLoweringBase::visit (AST::RangeFromExpr &expr) {} void -ASTLoweringBase::visit (AST::RangeToExpr &) +ASTLoweringBase::visit (AST::RangeToExpr &expr) {} void -ASTLoweringBase::visit (AST::RangeFullExpr &) +ASTLoweringBase::visit (AST::RangeFullExpr &expr) {} void -ASTLoweringBase::visit (AST::RangeFromToInclExpr &) +ASTLoweringBase::visit (AST::RangeFromToInclExpr &expr) {} void -ASTLoweringBase::visit (AST::RangeToInclExpr &) +ASTLoweringBase::visit (AST::RangeToInclExpr &expr) {} void -ASTLoweringBase::visit (AST::ReturnExpr &) +ASTLoweringBase::visit (AST::ReturnExpr &expr) {} void -ASTLoweringBase::visit (AST::UnsafeBlockExpr &) +ASTLoweringBase::visit (AST::UnsafeBlockExpr &expr) {} void -ASTLoweringBase::visit (AST::LoopExpr &) +ASTLoweringBase::visit (AST::LoopExpr &expr) {} void -ASTLoweringBase::visit (AST::WhileLoopExpr &) +ASTLoweringBase::visit (AST::WhileLoopExpr &expr) {} void -ASTLoweringBase::visit (AST::WhileLetLoopExpr &) +ASTLoweringBase::visit (AST::WhileLetLoopExpr &expr) {} void -ASTLoweringBase::visit (AST::ForLoopExpr &) +ASTLoweringBase::visit (AST::ForLoopExpr &expr) {} void -ASTLoweringBase::visit (AST::IfExpr &) +ASTLoweringBase::visit (AST::IfExpr &expr) {} void -ASTLoweringBase::visit (AST::IfExprConseqElse &) +ASTLoweringBase::visit (AST::IfExprConseqElse &expr) {} void -ASTLoweringBase::visit (AST::IfExprConseqIf &) +ASTLoweringBase::visit (AST::IfExprConseqIf &expr) {} void -ASTLoweringBase::visit (AST::IfExprConseqIfLet &) +ASTLoweringBase::visit (AST::IfExprConseqIfLet &expr) {} void -ASTLoweringBase::visit (AST::IfLetExpr &) +ASTLoweringBase::visit (AST::IfLetExpr &expr) {} void -ASTLoweringBase::visit (AST::IfLetExprConseqElse &) +ASTLoweringBase::visit (AST::IfLetExprConseqElse &expr) {} void -ASTLoweringBase::visit (AST::IfLetExprConseqIf &) +ASTLoweringBase::visit (AST::IfLetExprConseqIf &expr) {} void -ASTLoweringBase::visit (AST::IfLetExprConseqIfLet &) +ASTLoweringBase::visit (AST::IfLetExprConseqIfLet &expr) {} -// void ASTLoweringBase::visit(MatchCasematch_case) {} -// void ASTLoweringBase:: (AST::MatchCaseBlockExpr &) {} -// void ASTLoweringBase:: (AST::MatchCaseExpr &) {} +// void ASTLoweringBase::visit(MatchCase& match_case) {} +// void ASTLoweringBase:: (AST::MatchCaseBlockExpr &match_case) {} +// void ASTLoweringBase:: (AST::MatchCaseExpr &match_case) {} void -ASTLoweringBase::visit (AST::MatchExpr &) +ASTLoweringBase::visit (AST::MatchExpr &expr) {} void -ASTLoweringBase::visit (AST::AwaitExpr &) +ASTLoweringBase::visit (AST::AwaitExpr &expr) {} void -ASTLoweringBase::visit (AST::AsyncBlockExpr &) +ASTLoweringBase::visit (AST::AsyncBlockExpr &expr) {} // rust-item.h void -ASTLoweringBase::visit (AST::TypeParam &) +ASTLoweringBase::visit (AST::TypeParam ¶m) {} -// void ASTLoweringBase::visit(WhereClauseItemitem) {} +// void ASTLoweringBase::visit(WhereClauseItem& item) {} void -ASTLoweringBase::visit (AST::LifetimeWhereClauseItem &) +ASTLoweringBase::visit (AST::LifetimeWhereClauseItem &item) {} void -ASTLoweringBase::visit (AST::TypeBoundWhereClauseItem &) +ASTLoweringBase::visit (AST::TypeBoundWhereClauseItem &item) {} void -ASTLoweringBase::visit (AST::Method &) +ASTLoweringBase::visit (AST::Method &method) {} void -ASTLoweringBase::visit (AST::Module &) +ASTLoweringBase::visit (AST::Module &module) {} void -ASTLoweringBase::visit (AST::ExternCrate &) +ASTLoweringBase::visit (AST::ExternCrate &crate) {} -// void ASTLoweringBase::visit(UseTreeuse_tree) {} +// void ASTLoweringBase::visit(UseTree& use_tree) {} void -ASTLoweringBase::visit (AST::UseTreeGlob &) +ASTLoweringBase::visit (AST::UseTreeGlob &use_tree) {} void -ASTLoweringBase::visit (AST::UseTreeList &) +ASTLoweringBase::visit (AST::UseTreeList &use_tree) {} void -ASTLoweringBase::visit (AST::UseTreeRebind &) +ASTLoweringBase::visit (AST::UseTreeRebind &use_tree) {} void -ASTLoweringBase::visit (AST::UseDeclaration &) +ASTLoweringBase::visit (AST::UseDeclaration &use_decl) {} void -ASTLoweringBase::visit (AST::Function &) +ASTLoweringBase::visit (AST::Function &function) {} void -ASTLoweringBase::visit (AST::TypeAlias &) +ASTLoweringBase::visit (AST::TypeAlias &type_alias) {} void -ASTLoweringBase::visit (AST::StructStruct &) +ASTLoweringBase::visit (AST::StructStruct &struct_item) {} void -ASTLoweringBase::visit (AST::TupleStruct &) +ASTLoweringBase::visit (AST::TupleStruct &tuple_struct) {} void -ASTLoweringBase::visit (AST::EnumItem &) +ASTLoweringBase::visit (AST::EnumItem &item) {} void -ASTLoweringBase::visit (AST::EnumItemTuple &) +ASTLoweringBase::visit (AST::EnumItemTuple &item) {} void -ASTLoweringBase::visit (AST::EnumItemStruct &) +ASTLoweringBase::visit (AST::EnumItemStruct &item) {} void -ASTLoweringBase::visit (AST::EnumItemDiscriminant &) +ASTLoweringBase::visit (AST::EnumItemDiscriminant &item) {} void -ASTLoweringBase::visit (AST::Enum &) +ASTLoweringBase::visit (AST::Enum &enum_item) {} void -ASTLoweringBase::visit (AST::Union &) +ASTLoweringBase::visit (AST::Union &union_item) {} void -ASTLoweringBase::visit (AST::ConstantItem &) +ASTLoweringBase::visit (AST::ConstantItem &const_item) {} void -ASTLoweringBase::visit (AST::StaticItem &) +ASTLoweringBase::visit (AST::StaticItem &static_item) {} void -ASTLoweringBase::visit (AST::TraitItemFunc &) +ASTLoweringBase::visit (AST::TraitItemFunc &item) {} void -ASTLoweringBase::visit (AST::TraitItemMethod &) +ASTLoweringBase::visit (AST::TraitItemMethod &item) {} void -ASTLoweringBase::visit (AST::TraitItemConst &) +ASTLoweringBase::visit (AST::TraitItemConst &item) {} void -ASTLoweringBase::visit (AST::TraitItemType &) +ASTLoweringBase::visit (AST::TraitItemType &item) {} void -ASTLoweringBase::visit (AST::Trait &) +ASTLoweringBase::visit (AST::Trait &trait) {} void -ASTLoweringBase::visit (AST::InherentImpl &) +ASTLoweringBase::visit (AST::InherentImpl &impl) {} void -ASTLoweringBase::visit (AST::TraitImpl &) +ASTLoweringBase::visit (AST::TraitImpl &impl) {} -// void ASTLoweringBase::visit(ExternalItemitem) {} +// void ASTLoweringBase::visit(ExternalItem& item) {} void -ASTLoweringBase::visit (AST::ExternalStaticItem &) +ASTLoweringBase::visit (AST::ExternalStaticItem &item) {} void -ASTLoweringBase::visit (AST::ExternalFunctionItem &) +ASTLoweringBase::visit (AST::ExternalFunctionItem &item) {} void -ASTLoweringBase::visit (AST::ExternBlock &) +ASTLoweringBase::visit (AST::ExternBlock &block) {} // rust-macro.h void -ASTLoweringBase::visit (AST::MacroMatchFragment &) +ASTLoweringBase::visit (AST::MacroMatchFragment &match) {} void -ASTLoweringBase::visit (AST::MacroMatchRepetition &) +ASTLoweringBase::visit (AST::MacroMatchRepetition &match) {} void -ASTLoweringBase::visit (AST::MacroMatcher &) +ASTLoweringBase::visit (AST::MacroMatcher &matcher) {} void -ASTLoweringBase::visit (AST::MacroRulesDefinition &) +ASTLoweringBase::visit (AST::MacroRulesDefinition &rules_def) {} void -ASTLoweringBase::visit (AST::MacroInvocation &) +ASTLoweringBase::visit (AST::MacroInvocation ¯o_invoc) {} void -ASTLoweringBase::visit (AST::MetaItemPath &) +ASTLoweringBase::visit (AST::MetaItemPath &meta_item) {} void -ASTLoweringBase::visit (AST::MetaItemSeq &) +ASTLoweringBase::visit (AST::MetaItemSeq &meta_item) {} void -ASTLoweringBase::visit (AST::MetaWord &) +ASTLoweringBase::visit (AST::MetaWord &meta_item) {} void -ASTLoweringBase::visit (AST::MetaNameValueStr &) +ASTLoweringBase::visit (AST::MetaNameValueStr &meta_item) {} void -ASTLoweringBase::visit (AST::MetaListPaths &) +ASTLoweringBase::visit (AST::MetaListPaths &meta_item) {} void -ASTLoweringBase::visit (AST::MetaListNameValueStr &) +ASTLoweringBase::visit (AST::MetaListNameValueStr &meta_item) {} // rust-pattern.h void -ASTLoweringBase::visit (AST::LiteralPattern &) +ASTLoweringBase::visit (AST::LiteralPattern &pattern) {} void -ASTLoweringBase::visit (AST::IdentifierPattern &) +ASTLoweringBase::visit (AST::IdentifierPattern &pattern) {} void -ASTLoweringBase::visit (AST::WildcardPattern &) +ASTLoweringBase::visit (AST::WildcardPattern &pattern) {} -// void ASTLoweringBase::visit(RangePatternBoundbound) {} +// void ASTLoweringBase::visit(RangePatternBound& bound) {} void -ASTLoweringBase::visit (AST::RangePatternBoundLiteral &) +ASTLoweringBase::visit (AST::RangePatternBoundLiteral &bound) {} void -ASTLoweringBase::visit (AST::RangePatternBoundPath &) +ASTLoweringBase::visit (AST::RangePatternBoundPath &bound) {} void -ASTLoweringBase::visit (AST::RangePatternBoundQualPath &) +ASTLoweringBase::visit (AST::RangePatternBoundQualPath &bound) {} void -ASTLoweringBase::visit (AST::RangePattern &) +ASTLoweringBase::visit (AST::RangePattern &pattern) {} void -ASTLoweringBase::visit (AST::ReferencePattern &) +ASTLoweringBase::visit (AST::ReferencePattern &pattern) {} -// void ASTLoweringBase::visit(StructPatternFieldfield) {} +// void ASTLoweringBase::visit(StructPatternField& field) {} void -ASTLoweringBase::visit (AST::StructPatternFieldTuplePat &) +ASTLoweringBase::visit (AST::StructPatternFieldTuplePat &field) {} void -ASTLoweringBase::visit (AST::StructPatternFieldIdentPat &) +ASTLoweringBase::visit (AST::StructPatternFieldIdentPat &field) {} void -ASTLoweringBase::visit (AST::StructPatternFieldIdent &) +ASTLoweringBase::visit (AST::StructPatternFieldIdent &field) {} void -ASTLoweringBase::visit (AST::StructPattern &) +ASTLoweringBase::visit (AST::StructPattern &pattern) {} -// void ASTLoweringBase::visit(TupleStructItemstuple_items) {} +// void ASTLoweringBase::visit(TupleStructItems& tuple_items) {} void -ASTLoweringBase::visit (AST::TupleStructItemsNoRange &) +ASTLoweringBase::visit (AST::TupleStructItemsNoRange &tuple_items) {} void -ASTLoweringBase::visit (AST::TupleStructItemsRange &) +ASTLoweringBase::visit (AST::TupleStructItemsRange &tuple_items) {} void -ASTLoweringBase::visit (AST::TupleStructPattern &) +ASTLoweringBase::visit (AST::TupleStructPattern &pattern) {} -// void ASTLoweringBase::visit(TuplePatternItemstuple_items) {} +// void ASTLoweringBase::visit(TuplePatternItems& tuple_items) {} void -ASTLoweringBase::visit (AST::TuplePatternItemsMultiple &) +ASTLoweringBase::visit (AST::TuplePatternItemsMultiple &tuple_items) {} void -ASTLoweringBase::visit (AST::TuplePatternItemsRanged &) +ASTLoweringBase::visit (AST::TuplePatternItemsRanged &tuple_items) {} void -ASTLoweringBase::visit (AST::TuplePattern &) +ASTLoweringBase::visit (AST::TuplePattern &pattern) {} void -ASTLoweringBase::visit (AST::GroupedPattern &) +ASTLoweringBase::visit (AST::GroupedPattern &pattern) {} void -ASTLoweringBase::visit (AST::SlicePattern &) +ASTLoweringBase::visit (AST::SlicePattern &pattern) {} // rust-stmt.h void -ASTLoweringBase::visit (AST::EmptyStmt &) +ASTLoweringBase::visit (AST::EmptyStmt &stmt) {} void -ASTLoweringBase::visit (AST::LetStmt &) +ASTLoweringBase::visit (AST::LetStmt &stmt) {} void -ASTLoweringBase::visit (AST::ExprStmtWithoutBlock &) +ASTLoweringBase::visit (AST::ExprStmtWithoutBlock &stmt) {} void -ASTLoweringBase::visit (AST::ExprStmtWithBlock &) +ASTLoweringBase::visit (AST::ExprStmtWithBlock &stmt) {} // rust-type.h void -ASTLoweringBase::visit (AST::TraitBound &) +ASTLoweringBase::visit (AST::TraitBound &bound) {} void -ASTLoweringBase::visit (AST::ImplTraitType &) +ASTLoweringBase::visit (AST::ImplTraitType &type) {} void -ASTLoweringBase::visit (AST::TraitObjectType &) +ASTLoweringBase::visit (AST::TraitObjectType &type) {} void -ASTLoweringBase::visit (AST::ParenthesisedType &) +ASTLoweringBase::visit (AST::ParenthesisedType &type) {} void -ASTLoweringBase::visit (AST::ImplTraitTypeOneBound &) +ASTLoweringBase::visit (AST::ImplTraitTypeOneBound &type) {} void -ASTLoweringBase::visit (AST::TraitObjectTypeOneBound &) +ASTLoweringBase::visit (AST::TraitObjectTypeOneBound &type) {} void -ASTLoweringBase::visit (AST::TupleType &) +ASTLoweringBase::visit (AST::TupleType &type) {} void -ASTLoweringBase::visit (AST::NeverType &) +ASTLoweringBase::visit (AST::NeverType &type) {} void -ASTLoweringBase::visit (AST::RawPointerType &) +ASTLoweringBase::visit (AST::RawPointerType &type) {} void -ASTLoweringBase::visit (AST::ReferenceType &) +ASTLoweringBase::visit (AST::ReferenceType &type) {} void -ASTLoweringBase::visit (AST::ArrayType &) +ASTLoweringBase::visit (AST::ArrayType &type) {} void -ASTLoweringBase::visit (AST::SliceType &) +ASTLoweringBase::visit (AST::SliceType &type) {} void -ASTLoweringBase::visit (AST::InferredType &) +ASTLoweringBase::visit (AST::InferredType &type) {} void -ASTLoweringBase::visit (AST::BareFunctionType &) +ASTLoweringBase::visit (AST::BareFunctionType &type) {} HIR::Lifetime @@ -742,7 +742,7 @@ ASTLoweringBase::handle_outer_attributes (const ItemWrapper &item) } void -ASTLoweringBase::handle_doc_item_attribute (const ItemWrapper &, +ASTLoweringBase::handle_doc_item_attribute (const ItemWrapper &item, const AST::Attribute &attr) { auto simple_doc_comment = attr.has_attr_input () diff --git a/gcc/rust/hir/rust-hir-dump.cc b/gcc/rust/hir/rust-hir-dump.cc index 01d7132ce7e..11d4cd10527 100644 --- a/gcc/rust/hir/rust-hir-dump.cc +++ b/gcc/rust/hir/rust-hir-dump.cc @@ -200,7 +200,7 @@ void Dump::visit (ClosureExpr &) {} void -Dump::visit (BlockExpr &) +Dump::visit (BlockExpr &block_expr) { stream << "BlockExpr" << ":" @@ -324,7 +324,7 @@ void Dump::visit (UseDeclaration &) {} void -Dump::visit (Function &) +Dump::visit (Function &function) { indent++; stream << std::string (indent, indent_char); diff --git a/gcc/rust/hir/tree/rust-hir-full-test.cc b/gcc/rust/hir/tree/rust-hir-full-test.cc index a36e0f3d68a..7e5b49db1dc 100644 --- a/gcc/rust/hir/tree/rust-hir-full-test.cc +++ b/gcc/rust/hir/tree/rust-hir-full-test.cc @@ -5256,7 +5256,7 @@ ConstGenericParam::as_string () const } void -ConstGenericParam::accept_vis (HIRFullVisitor &) +ConstGenericParam::accept_vis (HIRFullVisitor &vis) {} } // namespace HIR diff --git a/gcc/rust/lex/rust-lex.cc b/gcc/rust/lex/rust-lex.cc index ea17ecc731f..8028c1b7a2d 100644 --- a/gcc/rust/lex/rust-lex.cc +++ b/gcc/rust/lex/rust-lex.cc @@ -1364,7 +1364,7 @@ Lexer::parse_escape (char opening_char) /* Parses an escape (or string continue) in a string or character. Supports * unicode escapes. */ std::tuple -Lexer::parse_utf8_escape () +Lexer::parse_utf8_escape (char opening_char) { Codepoint output_char; int additional_length_offset = 0; @@ -1964,7 +1964,7 @@ Lexer::parse_string (Location loc) if (current_char32.value == '\\') { // parse escape - auto utf8_escape_pair = parse_utf8_escape (); + auto utf8_escape_pair = parse_utf8_escape ('\''); current_char32 = std::get<0> (utf8_escape_pair); if (current_char32 == Codepoint (0) && std::get<2> (utf8_escape_pair)) @@ -2365,7 +2365,7 @@ Lexer::parse_char_or_lifetime (Location loc) if (current_char32.value == '\\') { // parse escape - auto utf8_escape_pair = parse_utf8_escape (); + auto utf8_escape_pair = parse_utf8_escape ('\''); current_char32 = std::get<0> (utf8_escape_pair); length += std::get<1> (utf8_escape_pair); diff --git a/gcc/rust/lex/rust-lex.h b/gcc/rust/lex/rust-lex.h index c05e2678c3d..2e8a1c541a1 100644 --- a/gcc/rust/lex/rust-lex.h +++ b/gcc/rust/lex/rust-lex.h @@ -109,7 +109,7 @@ private: std::pair parse_in_exponent_part (); std::pair parse_in_type_suffix (); std::tuple parse_escape (char opening_char); - std::tuple parse_utf8_escape (); + std::tuple parse_utf8_escape (char opening_char); int parse_partial_string_continue (); std::pair parse_partial_hex_escape (); std::pair parse_partial_unicode_escape (); diff --git a/gcc/rust/metadata/rust-export-metadata.cc b/gcc/rust/metadata/rust-export-metadata.cc index 67cc635ea9b..4856bc26149 100644 --- a/gcc/rust/metadata/rust-export-metadata.cc +++ b/gcc/rust/metadata/rust-export-metadata.cc @@ -157,18 +157,18 @@ class ExportVisItems : public HIR::HIRVisItemVisitor public: ExportVisItems (ExportContext &context) : ctx (context) {} - void visit (HIR::Module &) override {} - void visit (HIR::ExternCrate &) override {} - void visit (HIR::UseDeclaration &) override {} - void visit (HIR::TypeAlias &) override {} - void visit (HIR::StructStruct &) override {} - void visit (HIR::TupleStruct &) override {} - void visit (HIR::Enum &) override {} - void visit (HIR::Union &) override {} - void visit (HIR::ConstantItem &) override {} - void visit (HIR::StaticItem &) override {} - void visit (HIR::ImplBlock &) override {} - void visit (HIR::ExternBlock &) override {} + void visit (HIR::Module &module) override {} + void visit (HIR::ExternCrate &crate) override {} + void visit (HIR::UseDeclaration &use_decl) override {} + void visit (HIR::TypeAlias &type_alias) override {} + void visit (HIR::StructStruct &struct_item) override {} + void visit (HIR::TupleStruct &tuple_struct) override {} + void visit (HIR::Enum &enum_item) override {} + void visit (HIR::Union &union_item) override {} + void visit (HIR::ConstantItem &const_item) override {} + void visit (HIR::StaticItem &static_item) override {} + void visit (HIR::ImplBlock &impl) override {} + void visit (HIR::ExternBlock &block) override {} void visit (HIR::Trait &trait) override { ctx.emit_trait (trait); } diff --git a/gcc/rust/resolve/rust-ast-resolve-expr.cc b/gcc/rust/resolve/rust-ast-resolve-expr.cc index 96cf14292e6..60b3ebacc2c 100644 --- a/gcc/rust/resolve/rust-ast-resolve-expr.cc +++ b/gcc/rust/resolve/rust-ast-resolve-expr.cc @@ -102,7 +102,7 @@ ResolveExpr::visit (AST::AssignmentExpr &expr) ResolveExpr::go (expr.get_right_expr ().get (), prefix, canonical_prefix); // need to verify the assignee - VerifyAsignee::go (expr.get_left_expr ().get ()); + VerifyAsignee::go (expr.get_left_expr ().get (), expr.get_node_id ()); } void @@ -141,7 +141,7 @@ ResolveExpr::visit (AST::CompoundAssignmentExpr &expr) ResolveExpr::go (expr.get_right_expr ().get (), prefix, canonical_prefix); // need to verify the assignee - VerifyAsignee::go (expr.get_left_expr ().get ()); + VerifyAsignee::go (expr.get_left_expr ().get (), expr.get_node_id ()); } void @@ -553,7 +553,7 @@ ResolveExpr::visit (AST::RangeToExpr &expr) } void -ResolveExpr::visit (AST::RangeFullExpr &) +ResolveExpr::visit (AST::RangeFullExpr &expr) { // nothing to do } diff --git a/gcc/rust/resolve/rust-ast-resolve-type.cc b/gcc/rust/resolve/rust-ast-resolve-type.cc index 76eb93b9c38..e42bab68234 100644 --- a/gcc/rust/resolve/rust-ast-resolve-type.cc +++ b/gcc/rust/resolve/rust-ast-resolve-type.cc @@ -61,13 +61,13 @@ ResolveType::visit (AST::RawPointerType &type) } void -ResolveType::visit (AST::InferredType &) +ResolveType::visit (AST::InferredType &type) { // FIXME } void -ResolveType::visit (AST::NeverType &) +ResolveType::visit (AST::NeverType &type) { // FIXME } @@ -505,7 +505,7 @@ ResolveTypeToCanonicalPath::visit (AST::TraitObjectTypeOneBound &type) } void -ResolveTypeToCanonicalPath::visit (AST::TraitObjectType &) +ResolveTypeToCanonicalPath::visit (AST::TraitObjectType &type) { // FIXME is this actually allowed? dyn A+B gcc_unreachable (); diff --git a/gcc/rust/resolve/rust-ast-verify-assignee.h b/gcc/rust/resolve/rust-ast-verify-assignee.h index 28e6b3a0522..74551cb014d 100644 --- a/gcc/rust/resolve/rust-ast-verify-assignee.h +++ b/gcc/rust/resolve/rust-ast-verify-assignee.h @@ -30,9 +30,9 @@ class VerifyAsignee : public ResolverBase using Rust::Resolver::ResolverBase::visit; public: - static bool go (AST::Expr *assignee) + static bool go (AST::Expr *assignee, NodeId parent) { - VerifyAsignee checker; + VerifyAsignee checker (parent); assignee->accept_vis (checker); if (!checker.ok) rust_error_at (assignee->get_locus (), @@ -70,10 +70,10 @@ public: expr.get_dereferenced_expr ()->accept_vis (*this); } - void visit (AST::PathInExpression &) override { ok = true; } + void visit (AST::PathInExpression &expr) override { ok = true; } private: - VerifyAsignee () : ResolverBase (), ok (false) {} + VerifyAsignee (NodeId parent) : ResolverBase (), ok (false) {} bool ok; }; diff --git a/gcc/rust/resolve/rust-early-name-resolver.cc b/gcc/rust/resolve/rust-early-name-resolver.cc index 8100564dc78..6b1f1e9c52f 100644 --- a/gcc/rust/resolve/rust-early-name-resolver.cc +++ b/gcc/rust/resolve/rust-early-name-resolver.cc @@ -60,31 +60,31 @@ EarlyNameResolver::resolve_qualified_path_type (AST::QualifiedPathType &path) } void -EarlyNameResolver::visit (AST::Token &) +EarlyNameResolver::visit (AST::Token &tok) {} void -EarlyNameResolver::visit (AST::DelimTokenTree &) +EarlyNameResolver::visit (AST::DelimTokenTree &delim_tok_tree) {} void -EarlyNameResolver::visit (AST::AttrInputMetaItemContainer &) +EarlyNameResolver::visit (AST::AttrInputMetaItemContainer &input) {} void -EarlyNameResolver::visit (AST::IdentifierExpr &) +EarlyNameResolver::visit (AST::IdentifierExpr &ident_expr) {} void -EarlyNameResolver::visit (AST::Lifetime &) +EarlyNameResolver::visit (AST::Lifetime &lifetime) {} void -EarlyNameResolver::visit (AST::LifetimeParam &) +EarlyNameResolver::visit (AST::LifetimeParam &lifetime_param) {} void -EarlyNameResolver::visit (AST::ConstGenericParam &) +EarlyNameResolver::visit (AST::ConstGenericParam &const_param) {} // FIXME: ARTHUR: Do we need to perform macro resolution for paths as well? @@ -98,7 +98,7 @@ EarlyNameResolver::visit (AST::PathInExpression &path) } void -EarlyNameResolver::visit (AST::TypePathSegment &) +EarlyNameResolver::visit (AST::TypePathSegment &segment) {} void @@ -144,19 +144,19 @@ EarlyNameResolver::visit (AST::QualifiedPathInType &path) } void -EarlyNameResolver::visit (AST::LiteralExpr &) +EarlyNameResolver::visit (AST::LiteralExpr &expr) {} void -EarlyNameResolver::visit (AST::AttrInputLiteral &) +EarlyNameResolver::visit (AST::AttrInputLiteral &attr_input) {} void -EarlyNameResolver::visit (AST::MetaItemLitExpr &) +EarlyNameResolver::visit (AST::MetaItemLitExpr &meta_item) {} void -EarlyNameResolver::visit (AST::MetaItemPathLit &) +EarlyNameResolver::visit (AST::MetaItemPathLit &meta_item) {} void @@ -271,11 +271,11 @@ EarlyNameResolver::visit (AST::TupleIndexExpr &expr) } void -EarlyNameResolver::visit (AST::StructExprStruct &) +EarlyNameResolver::visit (AST::StructExprStruct &expr) {} void -EarlyNameResolver::visit (AST::StructExprFieldIdentifier &) +EarlyNameResolver::visit (AST::StructExprFieldIdentifier &field) {} void @@ -298,7 +298,7 @@ EarlyNameResolver::visit (AST::StructExprStructFields &expr) } void -EarlyNameResolver::visit (AST::StructExprStructBase &) +EarlyNameResolver::visit (AST::StructExprStructBase &expr) {} void @@ -352,7 +352,7 @@ EarlyNameResolver::visit (AST::ClosureExprInnerTyped &expr) } void -EarlyNameResolver::visit (AST::ContinueExpr &) +EarlyNameResolver::visit (AST::ContinueExpr &expr) {} void @@ -382,7 +382,7 @@ EarlyNameResolver::visit (AST::RangeToExpr &expr) } void -EarlyNameResolver::visit (AST::RangeFullExpr &) +EarlyNameResolver::visit (AST::RangeFullExpr &expr) {} void @@ -539,7 +539,7 @@ EarlyNameResolver::visit (AST::TypeParam ¶m) } void -EarlyNameResolver::visit (AST::LifetimeWhereClauseItem &) +EarlyNameResolver::visit (AST::LifetimeWhereClauseItem &item) {} void @@ -576,23 +576,23 @@ EarlyNameResolver::visit (AST::Module &module) } void -EarlyNameResolver::visit (AST::ExternCrate &) +EarlyNameResolver::visit (AST::ExternCrate &crate) {} void -EarlyNameResolver::visit (AST::UseTreeGlob &) +EarlyNameResolver::visit (AST::UseTreeGlob &use_tree) {} void -EarlyNameResolver::visit (AST::UseTreeList &) +EarlyNameResolver::visit (AST::UseTreeList &use_tree) {} void -EarlyNameResolver::visit (AST::UseTreeRebind &) +EarlyNameResolver::visit (AST::UseTreeRebind &use_tree) {} void -EarlyNameResolver::visit (AST::UseDeclaration &) +EarlyNameResolver::visit (AST::UseDeclaration &use_decl) {} void @@ -632,27 +632,27 @@ EarlyNameResolver::visit (AST::TupleStruct &tuple_struct) } void -EarlyNameResolver::visit (AST::EnumItem &) +EarlyNameResolver::visit (AST::EnumItem &item) {} void -EarlyNameResolver::visit (AST::EnumItemTuple &) +EarlyNameResolver::visit (AST::EnumItemTuple &item) {} void -EarlyNameResolver::visit (AST::EnumItemStruct &) +EarlyNameResolver::visit (AST::EnumItemStruct &item) {} void -EarlyNameResolver::visit (AST::EnumItemDiscriminant &) +EarlyNameResolver::visit (AST::EnumItemDiscriminant &item) {} void -EarlyNameResolver::visit (AST::Enum &) +EarlyNameResolver::visit (AST::Enum &enum_item) {} void -EarlyNameResolver::visit (AST::Union &) +EarlyNameResolver::visit (AST::Union &union_item) {} void @@ -716,7 +716,7 @@ EarlyNameResolver::visit (AST::TraitItemConst &item) } void -EarlyNameResolver::visit (AST::TraitItemType &) +EarlyNameResolver::visit (AST::TraitItemType &item) {} void @@ -777,15 +777,15 @@ EarlyNameResolver::visit (AST::ExternBlock &block) } void -EarlyNameResolver::visit (AST::MacroMatchFragment &) +EarlyNameResolver::visit (AST::MacroMatchFragment &match) {} void -EarlyNameResolver::visit (AST::MacroMatchRepetition &) +EarlyNameResolver::visit (AST::MacroMatchRepetition &match) {} void -EarlyNameResolver::visit (AST::MacroMatcher &) +EarlyNameResolver::visit (AST::MacroMatcher &matcher) {} void @@ -853,31 +853,31 @@ EarlyNameResolver::visit (AST::MacroInvocation &invoc) // FIXME: ARTHUR: Do we need to resolve these as well here? void -EarlyNameResolver::visit (AST::MetaItemPath &) +EarlyNameResolver::visit (AST::MetaItemPath &meta_item) {} void -EarlyNameResolver::visit (AST::MetaItemSeq &) +EarlyNameResolver::visit (AST::MetaItemSeq &meta_item) {} void -EarlyNameResolver::visit (AST::MetaWord &) +EarlyNameResolver::visit (AST::MetaWord &meta_item) {} void -EarlyNameResolver::visit (AST::MetaNameValueStr &) +EarlyNameResolver::visit (AST::MetaNameValueStr &meta_item) {} void -EarlyNameResolver::visit (AST::MetaListPaths &) +EarlyNameResolver::visit (AST::MetaListPaths &meta_item) {} void -EarlyNameResolver::visit (AST::MetaListNameValueStr &) +EarlyNameResolver::visit (AST::MetaListNameValueStr &meta_item) {} void -EarlyNameResolver::visit (AST::LiteralPattern &) +EarlyNameResolver::visit (AST::LiteralPattern &pattern) {} void @@ -888,19 +888,19 @@ EarlyNameResolver::visit (AST::IdentifierPattern &pattern) } void -EarlyNameResolver::visit (AST::WildcardPattern &) +EarlyNameResolver::visit (AST::WildcardPattern &pattern) {} void -EarlyNameResolver::visit (AST::RangePatternBoundLiteral &) +EarlyNameResolver::visit (AST::RangePatternBoundLiteral &bound) {} void -EarlyNameResolver::visit (AST::RangePatternBoundPath &) +EarlyNameResolver::visit (AST::RangePatternBoundPath &bound) {} void -EarlyNameResolver::visit (AST::RangePatternBoundQualPath &) +EarlyNameResolver::visit (AST::RangePatternBoundQualPath &bound) {} void @@ -929,11 +929,11 @@ EarlyNameResolver::visit (AST::StructPatternFieldIdentPat &field) } void -EarlyNameResolver::visit (AST::StructPatternFieldIdent &) +EarlyNameResolver::visit (AST::StructPatternFieldIdent &field) {} void -EarlyNameResolver::visit (AST::StructPattern &) +EarlyNameResolver::visit (AST::StructPattern &pattern) {} void @@ -994,7 +994,7 @@ EarlyNameResolver::visit (AST::SlicePattern &pattern) } void -EarlyNameResolver::visit (AST::EmptyStmt &) +EarlyNameResolver::visit (AST::EmptyStmt &stmt) {} void @@ -1022,55 +1022,55 @@ EarlyNameResolver::visit (AST::ExprStmtWithBlock &stmt) } void -EarlyNameResolver::visit (AST::TraitBound &) +EarlyNameResolver::visit (AST::TraitBound &bound) {} void -EarlyNameResolver::visit (AST::ImplTraitType &) +EarlyNameResolver::visit (AST::ImplTraitType &type) {} void -EarlyNameResolver::visit (AST::TraitObjectType &) +EarlyNameResolver::visit (AST::TraitObjectType &type) {} void -EarlyNameResolver::visit (AST::ParenthesisedType &) +EarlyNameResolver::visit (AST::ParenthesisedType &type) {} void -EarlyNameResolver::visit (AST::ImplTraitTypeOneBound &) +EarlyNameResolver::visit (AST::ImplTraitTypeOneBound &type) {} void -EarlyNameResolver::visit (AST::TraitObjectTypeOneBound &) +EarlyNameResolver::visit (AST::TraitObjectTypeOneBound &type) {} void -EarlyNameResolver::visit (AST::TupleType &) +EarlyNameResolver::visit (AST::TupleType &type) {} void -EarlyNameResolver::visit (AST::NeverType &) +EarlyNameResolver::visit (AST::NeverType &type) {} void -EarlyNameResolver::visit (AST::RawPointerType &) +EarlyNameResolver::visit (AST::RawPointerType &type) {} void -EarlyNameResolver::visit (AST::ReferenceType &) +EarlyNameResolver::visit (AST::ReferenceType &type) {} void -EarlyNameResolver::visit (AST::ArrayType &) +EarlyNameResolver::visit (AST::ArrayType &type) {} void -EarlyNameResolver::visit (AST::SliceType &) +EarlyNameResolver::visit (AST::SliceType &type) {} void -EarlyNameResolver::visit (AST::InferredType &) +EarlyNameResolver::visit (AST::InferredType &type) {} void diff --git a/gcc/rust/typecheck/rust-hir-dot-operator.cc b/gcc/rust/typecheck/rust-hir-dot-operator.cc index 9d42048f6df..46547aa20e0 100644 --- a/gcc/rust/typecheck/rust-hir-dot-operator.cc +++ b/gcc/rust/typecheck/rust-hir-dot-operator.cc @@ -58,7 +58,7 @@ MethodResolver::select (const TyTy::BaseType &receiver) // assemble inherent impl items std::vector inherent_impl_fns; mappings->iterate_impl_items ( - [&] (HirId, HIR::ImplItem *item, HIR::ImplBlock *impl) mutable -> bool { + [&] (HirId id, HIR::ImplItem *item, HIR::ImplBlock *impl) mutable -> bool { bool is_trait_impl = impl->has_trait_ref (); if (is_trait_impl) return true; @@ -102,7 +102,7 @@ MethodResolver::select (const TyTy::BaseType &receiver) }; std::vector trait_fns; - mappings->iterate_impl_blocks ([&] (HirId, + mappings->iterate_impl_blocks ([&] (HirId id, HIR::ImplBlock *impl) mutable -> bool { bool is_trait_impl = impl->has_trait_ref (); if (!is_trait_impl) diff --git a/gcc/rust/typecheck/rust-hir-inherent-impl-overlap.h b/gcc/rust/typecheck/rust-hir-inherent-impl-overlap.h index b9325c0bf69..823431eab4d 100644 --- a/gcc/rust/typecheck/rust-hir-inherent-impl-overlap.h +++ b/gcc/rust/typecheck/rust-hir-inherent-impl-overlap.h @@ -71,19 +71,20 @@ public: // generate mappings pass.mappings->iterate_impl_items ( - [&] (HirId, HIR::ImplItem *impl_item, HIR::ImplBlock *impl) -> bool { + [&] (HirId id, HIR::ImplItem *impl_item, HIR::ImplBlock *impl) -> bool { // ignoring trait-impls might need thought later on if (impl->has_trait_ref ()) return true; - pass.process_impl_item (impl_item, impl); + pass.process_impl_item (id, impl_item, impl); return true; }); pass.scan (); } - void process_impl_item (HIR::ImplItem *impl_item, HIR::ImplBlock *impl) + void process_impl_item (HirId id, HIR::ImplItem *impl_item, + HIR::ImplBlock *impl) { // lets make a mapping of impl-item Self type to (impl-item,name): // { diff --git a/gcc/rust/typecheck/rust-hir-path-probe.cc b/gcc/rust/typecheck/rust-hir-path-probe.cc index 5f42146257e..cb3270d3623 100644 --- a/gcc/rust/typecheck/rust-hir-path-probe.cc +++ b/gcc/rust/typecheck/rust-hir-path-probe.cc @@ -23,7 +23,7 @@ namespace Rust { namespace Resolver { void -PathProbeType::process_impl_item_candidate (HirId, HIR::ImplItem *item, +PathProbeType::process_impl_item_candidate (HirId id, HIR::ImplItem *item, HIR::ImplBlock *impl) { current_impl = impl; diff --git a/gcc/rust/typecheck/rust-hir-trait-ref.h b/gcc/rust/typecheck/rust-hir-trait-ref.h index 6895623bfda..d0814f60eaf 100644 --- a/gcc/rust/typecheck/rust-hir-trait-ref.h +++ b/gcc/rust/typecheck/rust-hir-trait-ref.h @@ -112,7 +112,8 @@ public: break; case TYPE: - return get_type_from_typealias (); + return get_type_from_typealias ( + static_cast (*hir_trait_item)); case FN: return get_type_from_fn ( @@ -148,7 +149,8 @@ private: return new TyTy::ErrorType (get_mappings ().get_hirid ()); } - TyTy::BaseType *get_type_from_typealias () const; + TyTy::BaseType *get_type_from_typealias (/*const*/ + HIR::TraitItemType &type) const; TyTy::BaseType * get_type_from_constant (/*const*/ HIR::TraitItemConst &constant) const; diff --git a/gcc/rust/typecheck/rust-hir-trait-resolve.cc b/gcc/rust/typecheck/rust-hir-trait-resolve.cc index 7760b1610d3..6bd3cc1a9e9 100644 --- a/gcc/rust/typecheck/rust-hir-trait-resolve.cc +++ b/gcc/rust/typecheck/rust-hir-trait-resolve.cc @@ -302,7 +302,7 @@ TraitItemReference::resolve_item (HIR::TraitItemType &type) } void -TraitItemReference::resolve_item (HIR::TraitItemConst &) +TraitItemReference::resolve_item (HIR::TraitItemConst &constant) { // TODO } diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.cc b/gcc/rust/typecheck/rust-hir-type-check-expr.cc index 0ea88f2b54f..8911a1d99f7 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-expr.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-expr.cc @@ -1152,7 +1152,7 @@ TypeCheckExpr::visit (HIR::MethodCallExpr &expr) rust_debug_loc (expr.get_method_name ().get_generic_args ().get_locus (), "applying generic arguments to method_call: {%s}", lookup->debug_str ().c_str ()); - HIR::GenericArgs args = expr.get_method_name ().get_generic_args (); + HIR::GenericArgs &args = expr.get_method_name ().get_generic_args (); lookup = SubstMapper::Resolve (lookup, expr.get_method_name ().get_locus (), &args); diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.h b/gcc/rust/typecheck/rust-hir-type-check-expr.h index 647c5f15c00..3ac8c4dfff8 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-expr.h +++ b/gcc/rust/typecheck/rust-hir-type-check-expr.h @@ -72,21 +72,27 @@ public: void visit (HIR::ClosureExpr &expr) override; // TODO - void visit (HIR::ErrorPropagationExpr &) override {} - void visit (HIR::RangeToInclExpr &) override {} - void visit (HIR::WhileLetLoopExpr &) override {} - void visit (HIR::ForLoopExpr &) override {} - void visit (HIR::IfExprConseqIfLet &) override {} - void visit (HIR::IfLetExprConseqElse &) override {} - void visit (HIR::IfLetExprConseqIf &) override {} - void visit (HIR::IfLetExprConseqIfLet &) override {} - void visit (HIR::AwaitExpr &) override {} - void visit (HIR::AsyncBlockExpr &) override {} + void visit (HIR::ErrorPropagationExpr &expr) override {} + void visit (HIR::RangeToInclExpr &expr) override {} + void visit (HIR::WhileLetLoopExpr &expr) override {} + void visit (HIR::ForLoopExpr &expr) override {} + void visit (HIR::IfExprConseqIfLet &expr) override {} + void visit (HIR::IfLetExprConseqElse &expr) override {} + void visit (HIR::IfLetExprConseqIf &expr) override {} + void visit (HIR::IfLetExprConseqIfLet &expr) override {} + void visit (HIR::AwaitExpr &expr) override {} + void visit (HIR::AsyncBlockExpr &expr) override {} // don't need to implement these see rust-hir-type-check-struct-field.h - void visit (HIR::StructExprFieldIdentifier &) override { gcc_unreachable (); } - void visit (HIR::StructExprFieldIndexValue &) override { gcc_unreachable (); } - void visit (HIR::StructExprFieldIdentifierValue &) override + void visit (HIR::StructExprFieldIdentifier &field) override + { + gcc_unreachable (); + } + void visit (HIR::StructExprFieldIdentifierValue &field) override + { + gcc_unreachable (); + } + void visit (HIR::StructExprFieldIndexValue &field) override { gcc_unreachable (); } diff --git a/gcc/rust/typecheck/rust-hir-type-check-item.h b/gcc/rust/typecheck/rust-hir-type-check-item.h index 351f8435d87..3b88157f5ae 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-item.h +++ b/gcc/rust/typecheck/rust-hir-type-check-item.h @@ -48,8 +48,8 @@ public: void visit (HIR::Trait &trait_block) override; // nothing to do - void visit (HIR::ExternCrate &) override {} - void visit (HIR::UseDeclaration &) override {} + void visit (HIR::ExternCrate &crate) override {} + void visit (HIR::UseDeclaration &use_decl) override {} protected: std::vector diff --git a/gcc/rust/typecheck/rust-hir-type-check-path.cc b/gcc/rust/typecheck/rust-hir-type-check-path.cc index 1ac8a313239..4e765ad1380 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-path.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-path.cc @@ -337,7 +337,7 @@ TypeCheckExpr::resolve_segments (NodeId root_resolved_node_id, return; } - auto candidate = *candidates.begin (); + auto &candidate = *candidates.begin (); prev_segment = tyseg; tyseg = candidate.ty; diff --git a/gcc/rust/typecheck/rust-hir-type-check-pattern.cc b/gcc/rust/typecheck/rust-hir-type-check-pattern.cc index 9bff8e31aee..a6423bef7b8 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-pattern.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-pattern.cc @@ -381,34 +381,34 @@ TypeCheckPattern::visit (HIR::RangePattern &pattern) } void -TypeCheckPattern::visit (HIR::IdentifierPattern &) +TypeCheckPattern::visit (HIR::IdentifierPattern &pattern) { infered = parent; } void -TypeCheckPattern::visit (HIR::GroupedPattern &) +TypeCheckPattern::visit (HIR::GroupedPattern &pattern) { // TODO gcc_unreachable (); } void -TypeCheckPattern::visit (HIR::QualifiedPathInExpression &) +TypeCheckPattern::visit (HIR::QualifiedPathInExpression &pattern) { // TODO gcc_unreachable (); } void -TypeCheckPattern::visit (HIR::ReferencePattern &) +TypeCheckPattern::visit (HIR::ReferencePattern &pattern) { // TODO gcc_unreachable (); } void -TypeCheckPattern::visit (HIR::SlicePattern &) +TypeCheckPattern::visit (HIR::SlicePattern &pattern) { // TODO gcc_unreachable (); diff --git a/gcc/rust/typecheck/rust-hir-type-check-stmt.h b/gcc/rust/typecheck/rust-hir-type-check-stmt.h index 59408a36651..5d894a7e703 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-stmt.h +++ b/gcc/rust/typecheck/rust-hir-type-check-stmt.h @@ -50,11 +50,14 @@ public: // FIXME // this seems like it should not be part of this visitor - void visit (HIR::TypePathSegmentFunction &) override { gcc_unreachable (); } + void visit (HIR::TypePathSegmentFunction &segment) override + { + gcc_unreachable (); + } // nothing to do for these - void visit (HIR::ExternCrate &) override {} - void visit (HIR::UseDeclaration &) override {} + void visit (HIR::ExternCrate &crate) override {} + void visit (HIR::UseDeclaration &use_decl) override {} // nothing to do for these as they are taken care of by the // hir-type-check-enumitem.h diff --git a/gcc/rust/typecheck/rust-hir-type-check-type.cc b/gcc/rust/typecheck/rust-hir-type-check-type.cc index 7870c55e57f..67e6cb0e739 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-type.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-type.cc @@ -462,7 +462,7 @@ TypeCheckType::resolve_segments ( return new TyTy::ErrorType (expr_id); } - auto candidate = *candidates.begin (); + auto &candidate = *candidates.begin (); prev_segment = tyseg; tyseg = candidate.ty; @@ -635,7 +635,7 @@ TypeCheckType::visit (HIR::InferredType &type) } void -TypeCheckType::visit (HIR::NeverType &) +TypeCheckType::visit (HIR::NeverType &type) { TyTy::BaseType *lookup = nullptr; bool ok = context->lookup_builtin ("!", &lookup); @@ -666,13 +666,13 @@ TypeResolveGenericParam::Resolve (HIR::GenericParam *param) } void -TypeResolveGenericParam::visit (HIR::LifetimeParam &) +TypeResolveGenericParam::visit (HIR::LifetimeParam ¶m) { // nothing to do } void -TypeResolveGenericParam::visit (HIR::ConstGenericParam &) +TypeResolveGenericParam::visit (HIR::ConstGenericParam ¶m) { // TODO } @@ -730,7 +730,7 @@ ResolveWhereClauseItem::Resolve (HIR::WhereClauseItem &item) } void -ResolveWhereClauseItem::visit (HIR::LifetimeWhereClauseItem &) +ResolveWhereClauseItem::visit (HIR::LifetimeWhereClauseItem &item) {} void diff --git a/gcc/rust/typecheck/rust-hir-type-check-type.h b/gcc/rust/typecheck/rust-hir-type-check-type.h index 611c42ed734..90d5ddbb411 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-type.h +++ b/gcc/rust/typecheck/rust-hir-type-check-type.h @@ -62,19 +62,19 @@ public: void visit (HIR::NeverType &type) override; void visit (HIR::TraitObjectType &type) override; - void visit (HIR::TypePathSegmentFunction &) override + void visit (HIR::TypePathSegmentFunction &segment) override { /* TODO */ } - void visit (HIR::TraitBound &) override + void visit (HIR::TraitBound &bound) override { /* TODO */ } - void visit (HIR::ImplTraitType &) override + void visit (HIR::ImplTraitType &type) override { /* TODO */ } - void visit (HIR::ParenthesisedType &) override + void visit (HIR::ParenthesisedType &type) override { /* TODO */ } - void visit (HIR::ImplTraitTypeOneBound &) override + void visit (HIR::ImplTraitTypeOneBound &type) override { /* TODO */ } diff --git a/gcc/rust/typecheck/rust-hir-type-check.cc b/gcc/rust/typecheck/rust-hir-type-check.cc index b756ad0b707..a85ea5c8491 100644 --- a/gcc/rust/typecheck/rust-hir-type-check.cc +++ b/gcc/rust/typecheck/rust-hir-type-check.cc @@ -125,7 +125,8 @@ TraitItemReference::operator= (TraitItemReference const &other) } TyTy::BaseType * -TraitItemReference::get_type_from_typealias () const +TraitItemReference::get_type_from_typealias (/*const*/ + HIR::TraitItemType &type) const { TyTy::TyVar var (get_mappings ().get_hirid ()); return var.get_tyty (); diff --git a/gcc/rust/typecheck/rust-tyty-bounds.cc b/gcc/rust/typecheck/rust-tyty-bounds.cc index 0109573317d..53eccb79d93 100644 --- a/gcc/rust/typecheck/rust-tyty-bounds.cc +++ b/gcc/rust/typecheck/rust-tyty-bounds.cc @@ -29,7 +29,7 @@ TypeBoundsProbe::scan () std::vector> possible_trait_paths; mappings->iterate_impl_blocks ( - [&] (HirId, HIR::ImplBlock *impl) mutable -> bool { + [&] (HirId id, HIR::ImplBlock *impl) mutable -> bool { // we are filtering for trait-impl-blocks if (!impl->has_trait_ref ()) return true; diff --git a/gcc/rust/typecheck/rust-tyty-call.h b/gcc/rust/typecheck/rust-tyty-call.h index 6f867d985b9..eef567ac419 100644 --- a/gcc/rust/typecheck/rust-tyty-call.h +++ b/gcc/rust/typecheck/rust-tyty-call.h @@ -60,7 +60,7 @@ public: void visit (PlaceholderType &) override { gcc_unreachable (); } void visit (ProjectionType &) override { gcc_unreachable (); } void visit (DynamicObjectType &) override { gcc_unreachable (); } - void visit (ClosureType &) override { gcc_unreachable (); } + void visit (ClosureType &type) override { gcc_unreachable (); } // tuple-structs void visit (ADTType &type) override; diff --git a/gcc/rust/typecheck/rust-tyty-cmp.h b/gcc/rust/typecheck/rust-tyty-cmp.h index 7c30b0205a9..23e52d94166 100644 --- a/gcc/rust/typecheck/rust-tyty-cmp.h +++ b/gcc/rust/typecheck/rust-tyty-cmp.h @@ -381,7 +381,7 @@ public: } } - virtual void visit (const PlaceholderType &) override + virtual void visit (const PlaceholderType &type) override { // it is ok for types to can eq to a placeholder ok = true; @@ -436,7 +436,7 @@ public: } protected: - BaseCmp (const BaseType *, bool emit_errors) + BaseCmp (const BaseType *base, bool emit_errors) : mappings (Analysis::Mappings::get ()), context (Resolver::TypeCheckContext::get ()), ok (false), emit_error_flag (emit_errors) @@ -986,7 +986,7 @@ public: : BaseCmp (base, emit_errors), base (base) {} - void visit (const BoolType &) override { ok = true; } + void visit (const BoolType &type) override { ok = true; } void visit (const InferType &type) override { @@ -1207,7 +1207,7 @@ public: ok = type.get_infer_kind () != InferType::InferTypeKind::FLOAT; } - void visit (const USizeType &) override { ok = true; } + void visit (const USizeType &type) override { ok = true; } private: const BaseType *get_base () const override { return base; } @@ -1228,7 +1228,7 @@ public: ok = type.get_infer_kind () != InferType::InferTypeKind::FLOAT; } - void visit (const ISizeType &) override { ok = true; } + void visit (const ISizeType &type) override { ok = true; } private: const BaseType *get_base () const override { return base; } @@ -1249,7 +1249,7 @@ public: ok = type.get_infer_kind () == InferType::InferTypeKind::GENERAL; } - void visit (const CharType &) override { ok = true; } + void visit (const CharType &type) override { ok = true; } private: const BaseType *get_base () const override { return base; } @@ -1447,7 +1447,7 @@ public: : BaseCmp (base, emit_errors), base (base) {} - void visit (const StrType &) override { ok = true; } + void visit (const StrType &type) override { ok = true; } void visit (const InferType &type) override { @@ -1474,7 +1474,7 @@ public: : BaseCmp (base, emit_errors), base (base) {} - void visit (const NeverType &) override { ok = true; } + void visit (const NeverType &type) override { ok = true; } void visit (const InferType &type) override { diff --git a/gcc/rust/typecheck/rust-tyty-rules.h b/gcc/rust/typecheck/rust-tyty-rules.h index dbb808b644e..fe654cad129 100644 --- a/gcc/rust/typecheck/rust-tyty-rules.h +++ b/gcc/rust/typecheck/rust-tyty-rules.h @@ -123,53 +123,53 @@ public: return resolved; } - virtual void visit (TupleType &) override {} + virtual void visit (TupleType &type) override {} - virtual void visit (ADTType &) override {} + virtual void visit (ADTType &type) override {} - virtual void visit (InferType &) override {} + virtual void visit (InferType &type) override {} - virtual void visit (FnType &) override {} + virtual void visit (FnType &type) override {} - virtual void visit (FnPtr &) override {} + virtual void visit (FnPtr &type) override {} - virtual void visit (ArrayType &) override {} + virtual void visit (ArrayType &type) override {} - virtual void visit (SliceType &) override {} + virtual void visit (SliceType &type) override {} - virtual void visit (BoolType &) override {} + virtual void visit (BoolType &type) override {} - virtual void visit (IntType &) override {} + virtual void visit (IntType &type) override {} - virtual void visit (UintType &) override {} + virtual void visit (UintType &type) override {} - virtual void visit (USizeType &) override {} + virtual void visit (USizeType &type) override {} - virtual void visit (ISizeType &) override {} + virtual void visit (ISizeType &type) override {} - virtual void visit (FloatType &) override {} + virtual void visit (FloatType &type) override {} - virtual void visit (ErrorType &) override {} + virtual void visit (ErrorType &type) override {} - virtual void visit (CharType &) override {} + virtual void visit (CharType &type) override {} - virtual void visit (ReferenceType &) override {} + virtual void visit (ReferenceType &type) override {} - virtual void visit (PointerType &) override {} + virtual void visit (PointerType &type) override {} - virtual void visit (ParamType &) override {} + virtual void visit (ParamType &type) override {} - virtual void visit (StrType &) override {} + virtual void visit (StrType &type) override {} - virtual void visit (NeverType &) override {} + virtual void visit (NeverType &type) override {} - virtual void visit (PlaceholderType &) override {} + virtual void visit (PlaceholderType &type) override {} - virtual void visit (ProjectionType &) override {} + virtual void visit (ProjectionType &type) override {} - virtual void visit (DynamicObjectType &) override {} + virtual void visit (DynamicObjectType &type) override {} - virtual void visit (ClosureType &) override {} + virtual void visit (ClosureType &type) override {} protected: BaseRules (BaseType *base) diff --git a/gcc/rust/typecheck/rust-tyty.cc b/gcc/rust/typecheck/rust-tyty.cc index 64157fb76d8..e56bdd17b87 100644 --- a/gcc/rust/typecheck/rust-tyty.cc +++ b/gcc/rust/typecheck/rust-tyty.cc @@ -544,13 +544,13 @@ ErrorType::as_string () const } BaseType * -ErrorType::unify (BaseType *) +ErrorType::unify (BaseType *other) { return this; } bool -ErrorType::can_eq (const BaseType *other, bool) const +ErrorType::can_eq (const BaseType *other, bool emit_errors) const { return get_kind () == other->get_kind (); } @@ -1724,7 +1724,8 @@ ClosureType::monomorphized_clone () const return clone (); } -ClosureType *ClosureType::handle_substitions (SubstitutionArgumentMappings) +ClosureType * +ClosureType::handle_substitions (SubstitutionArgumentMappings mappings) { gcc_unreachable (); return nullptr; diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc index 1cdc122177c..64ed042324c 100644 --- a/gcc/rust/util/rust-attributes.cc +++ b/gcc/rust/util/rust-attributes.cc @@ -210,342 +210,342 @@ AttributeChecker::check_attributes (const AST::AttrVec &attributes) } void -AttributeChecker::visit (AST::Token &) +AttributeChecker::visit (AST::Token &tok) {} void -AttributeChecker::visit (AST::DelimTokenTree &) +AttributeChecker::visit (AST::DelimTokenTree &delim_tok_tree) {} void -AttributeChecker::visit (AST::AttrInputMetaItemContainer &) +AttributeChecker::visit (AST::AttrInputMetaItemContainer &input) {} void -AttributeChecker::visit (AST::IdentifierExpr &) +AttributeChecker::visit (AST::IdentifierExpr &ident_expr) {} void -AttributeChecker::visit (AST::Lifetime &) +AttributeChecker::visit (AST::Lifetime &lifetime) {} void -AttributeChecker::visit (AST::LifetimeParam &) +AttributeChecker::visit (AST::LifetimeParam &lifetime_param) {} void -AttributeChecker::visit (AST::ConstGenericParam &) +AttributeChecker::visit (AST::ConstGenericParam &const_param) {} // rust-path.h void -AttributeChecker::visit (AST::PathInExpression &) +AttributeChecker::visit (AST::PathInExpression &path) {} void -AttributeChecker::visit (AST::TypePathSegment &) +AttributeChecker::visit (AST::TypePathSegment &segment) {} void -AttributeChecker::visit (AST::TypePathSegmentGeneric &) +AttributeChecker::visit (AST::TypePathSegmentGeneric &segment) {} void -AttributeChecker::visit (AST::TypePathSegmentFunction &) +AttributeChecker::visit (AST::TypePathSegmentFunction &segment) {} void -AttributeChecker::visit (AST::TypePath &) +AttributeChecker::visit (AST::TypePath &path) {} void -AttributeChecker::visit (AST::QualifiedPathInExpression &) +AttributeChecker::visit (AST::QualifiedPathInExpression &path) {} void -AttributeChecker::visit (AST::QualifiedPathInType &) +AttributeChecker::visit (AST::QualifiedPathInType &path) {} // rust-expr.h void -AttributeChecker::visit (AST::LiteralExpr &) +AttributeChecker::visit (AST::LiteralExpr &expr) {} void -AttributeChecker::visit (AST::AttrInputLiteral &) +AttributeChecker::visit (AST::AttrInputLiteral &attr_input) {} void -AttributeChecker::visit (AST::MetaItemLitExpr &) +AttributeChecker::visit (AST::MetaItemLitExpr &meta_item) {} void -AttributeChecker::visit (AST::MetaItemPathLit &) +AttributeChecker::visit (AST::MetaItemPathLit &meta_item) {} void -AttributeChecker::visit (AST::BorrowExpr &) +AttributeChecker::visit (AST::BorrowExpr &expr) {} void -AttributeChecker::visit (AST::DereferenceExpr &) +AttributeChecker::visit (AST::DereferenceExpr &expr) {} void -AttributeChecker::visit (AST::ErrorPropagationExpr &) +AttributeChecker::visit (AST::ErrorPropagationExpr &expr) {} void -AttributeChecker::visit (AST::NegationExpr &) +AttributeChecker::visit (AST::NegationExpr &expr) {} void -AttributeChecker::visit (AST::ArithmeticOrLogicalExpr &) +AttributeChecker::visit (AST::ArithmeticOrLogicalExpr &expr) {} void -AttributeChecker::visit (AST::ComparisonExpr &) +AttributeChecker::visit (AST::ComparisonExpr &expr) {} void -AttributeChecker::visit (AST::LazyBooleanExpr &) +AttributeChecker::visit (AST::LazyBooleanExpr &expr) {} void -AttributeChecker::visit (AST::TypeCastExpr &) +AttributeChecker::visit (AST::TypeCastExpr &expr) {} void -AttributeChecker::visit (AST::AssignmentExpr &) +AttributeChecker::visit (AST::AssignmentExpr &expr) {} void -AttributeChecker::visit (AST::CompoundAssignmentExpr &) +AttributeChecker::visit (AST::CompoundAssignmentExpr &expr) {} void -AttributeChecker::visit (AST::GroupedExpr &) +AttributeChecker::visit (AST::GroupedExpr &expr) {} void -AttributeChecker::visit (AST::ArrayElemsValues &) +AttributeChecker::visit (AST::ArrayElemsValues &elems) {} void -AttributeChecker::visit (AST::ArrayElemsCopied &) +AttributeChecker::visit (AST::ArrayElemsCopied &elems) {} void -AttributeChecker::visit (AST::ArrayExpr &) +AttributeChecker::visit (AST::ArrayExpr &expr) {} void -AttributeChecker::visit (AST::ArrayIndexExpr &) +AttributeChecker::visit (AST::ArrayIndexExpr &expr) {} void -AttributeChecker::visit (AST::TupleExpr &) +AttributeChecker::visit (AST::TupleExpr &expr) {} void -AttributeChecker::visit (AST::TupleIndexExpr &) +AttributeChecker::visit (AST::TupleIndexExpr &expr) {} void -AttributeChecker::visit (AST::StructExprStruct &) +AttributeChecker::visit (AST::StructExprStruct &expr) {} void -AttributeChecker::visit (AST::StructExprFieldIdentifier &) +AttributeChecker::visit (AST::StructExprFieldIdentifier &field) {} void -AttributeChecker::visit (AST::StructExprFieldIdentifierValue &) +AttributeChecker::visit (AST::StructExprFieldIdentifierValue &field) {} void -AttributeChecker::visit (AST::StructExprFieldIndexValue &) +AttributeChecker::visit (AST::StructExprFieldIndexValue &field) {} void -AttributeChecker::visit (AST::StructExprStructFields &) +AttributeChecker::visit (AST::StructExprStructFields &expr) {} void -AttributeChecker::visit (AST::StructExprStructBase &) +AttributeChecker::visit (AST::StructExprStructBase &expr) {} void -AttributeChecker::visit (AST::CallExpr &) +AttributeChecker::visit (AST::CallExpr &expr) {} void -AttributeChecker::visit (AST::MethodCallExpr &) +AttributeChecker::visit (AST::MethodCallExpr &expr) {} void -AttributeChecker::visit (AST::FieldAccessExpr &) +AttributeChecker::visit (AST::FieldAccessExpr &expr) {} void -AttributeChecker::visit (AST::ClosureExprInner &) +AttributeChecker::visit (AST::ClosureExprInner &expr) {} void -AttributeChecker::visit (AST::BlockExpr &) +AttributeChecker::visit (AST::BlockExpr &expr) {} void -AttributeChecker::visit (AST::ClosureExprInnerTyped &) +AttributeChecker::visit (AST::ClosureExprInnerTyped &expr) {} void -AttributeChecker::visit (AST::ContinueExpr &) +AttributeChecker::visit (AST::ContinueExpr &expr) {} void -AttributeChecker::visit (AST::BreakExpr &) +AttributeChecker::visit (AST::BreakExpr &expr) {} void -AttributeChecker::visit (AST::RangeFromToExpr &) +AttributeChecker::visit (AST::RangeFromToExpr &expr) {} void -AttributeChecker::visit (AST::RangeFromExpr &) +AttributeChecker::visit (AST::RangeFromExpr &expr) {} void -AttributeChecker::visit (AST::RangeToExpr &) +AttributeChecker::visit (AST::RangeToExpr &expr) {} void -AttributeChecker::visit (AST::RangeFullExpr &) +AttributeChecker::visit (AST::RangeFullExpr &expr) {} void -AttributeChecker::visit (AST::RangeFromToInclExpr &) +AttributeChecker::visit (AST::RangeFromToInclExpr &expr) {} void -AttributeChecker::visit (AST::RangeToInclExpr &) +AttributeChecker::visit (AST::RangeToInclExpr &expr) {} void -AttributeChecker::visit (AST::ReturnExpr &) +AttributeChecker::visit (AST::ReturnExpr &expr) {} void -AttributeChecker::visit (AST::UnsafeBlockExpr &) +AttributeChecker::visit (AST::UnsafeBlockExpr &expr) {} void -AttributeChecker::visit (AST::LoopExpr &) +AttributeChecker::visit (AST::LoopExpr &expr) {} void -AttributeChecker::visit (AST::WhileLoopExpr &) +AttributeChecker::visit (AST::WhileLoopExpr &expr) {} void -AttributeChecker::visit (AST::WhileLetLoopExpr &) +AttributeChecker::visit (AST::WhileLetLoopExpr &expr) {} void -AttributeChecker::visit (AST::ForLoopExpr &) +AttributeChecker::visit (AST::ForLoopExpr &expr) {} void -AttributeChecker::visit (AST::IfExpr &) +AttributeChecker::visit (AST::IfExpr &expr) {} void -AttributeChecker::visit (AST::IfExprConseqElse &) +AttributeChecker::visit (AST::IfExprConseqElse &expr) {} void -AttributeChecker::visit (AST::IfExprConseqIf &) +AttributeChecker::visit (AST::IfExprConseqIf &expr) {} void -AttributeChecker::visit (AST::IfExprConseqIfLet &) +AttributeChecker::visit (AST::IfExprConseqIfLet &expr) {} void -AttributeChecker::visit (AST::IfLetExpr &) +AttributeChecker::visit (AST::IfLetExpr &expr) {} void -AttributeChecker::visit (AST::IfLetExprConseqElse &) +AttributeChecker::visit (AST::IfLetExprConseqElse &expr) {} void -AttributeChecker::visit (AST::IfLetExprConseqIf &) +AttributeChecker::visit (AST::IfLetExprConseqIf &expr) {} void -AttributeChecker::visit (AST::IfLetExprConseqIfLet &) +AttributeChecker::visit (AST::IfLetExprConseqIfLet &expr) {} void -AttributeChecker::visit (AST::MatchExpr &) +AttributeChecker::visit (AST::MatchExpr &expr) {} void -AttributeChecker::visit (AST::AwaitExpr &) +AttributeChecker::visit (AST::AwaitExpr &expr) {} void -AttributeChecker::visit (AST::AsyncBlockExpr &) +AttributeChecker::visit (AST::AsyncBlockExpr &expr) {} // rust-item.h void -AttributeChecker::visit (AST::TypeParam &) +AttributeChecker::visit (AST::TypeParam ¶m) {} void -AttributeChecker::visit (AST::LifetimeWhereClauseItem &) +AttributeChecker::visit (AST::LifetimeWhereClauseItem &item) {} void -AttributeChecker::visit (AST::TypeBoundWhereClauseItem &) +AttributeChecker::visit (AST::TypeBoundWhereClauseItem &item) {} void -AttributeChecker::visit (AST::Method &) +AttributeChecker::visit (AST::Method &method) {} void -AttributeChecker::visit (AST::Module &) +AttributeChecker::visit (AST::Module &module) {} void -AttributeChecker::visit (AST::ExternCrate &) +AttributeChecker::visit (AST::ExternCrate &crate) {} void -AttributeChecker::visit (AST::UseTreeGlob &) +AttributeChecker::visit (AST::UseTreeGlob &use_tree) {} void -AttributeChecker::visit (AST::UseTreeList &) +AttributeChecker::visit (AST::UseTreeList &use_tree) {} void -AttributeChecker::visit (AST::UseTreeRebind &) +AttributeChecker::visit (AST::UseTreeRebind &use_tree) {} void -AttributeChecker::visit (AST::UseDeclaration &) +AttributeChecker::visit (AST::UseDeclaration &use_decl) {} void -AttributeChecker::visit (AST::Function &) +AttributeChecker::visit (AST::Function &function) {} void -AttributeChecker::visit (AST::TypeAlias &) +AttributeChecker::visit (AST::TypeAlias &type_alias) {} void @@ -555,287 +555,287 @@ AttributeChecker::visit (AST::StructStruct &struct_item) } void -AttributeChecker::visit (AST::TupleStruct &) +AttributeChecker::visit (AST::TupleStruct &tuple_struct) {} void -AttributeChecker::visit (AST::EnumItem &) +AttributeChecker::visit (AST::EnumItem &item) {} void -AttributeChecker::visit (AST::EnumItemTuple &) +AttributeChecker::visit (AST::EnumItemTuple &item) {} void -AttributeChecker::visit (AST::EnumItemStruct &) +AttributeChecker::visit (AST::EnumItemStruct &item) {} void -AttributeChecker::visit (AST::EnumItemDiscriminant &) +AttributeChecker::visit (AST::EnumItemDiscriminant &item) {} void -AttributeChecker::visit (AST::Enum &) +AttributeChecker::visit (AST::Enum &enum_item) {} void -AttributeChecker::visit (AST::Union &) +AttributeChecker::visit (AST::Union &union_item) {} void -AttributeChecker::visit (AST::ConstantItem &) +AttributeChecker::visit (AST::ConstantItem &const_item) {} void -AttributeChecker::visit (AST::StaticItem &) +AttributeChecker::visit (AST::StaticItem &static_item) {} void -AttributeChecker::visit (AST::TraitItemFunc &) +AttributeChecker::visit (AST::TraitItemFunc &item) {} void -AttributeChecker::visit (AST::TraitItemMethod &) +AttributeChecker::visit (AST::TraitItemMethod &item) {} void -AttributeChecker::visit (AST::TraitItemConst &) +AttributeChecker::visit (AST::TraitItemConst &item) {} void -AttributeChecker::visit (AST::TraitItemType &) +AttributeChecker::visit (AST::TraitItemType &item) {} void -AttributeChecker::visit (AST::Trait &) +AttributeChecker::visit (AST::Trait &trait) {} void -AttributeChecker::visit (AST::InherentImpl &) +AttributeChecker::visit (AST::InherentImpl &impl) {} void -AttributeChecker::visit (AST::TraitImpl &) +AttributeChecker::visit (AST::TraitImpl &impl) {} void -AttributeChecker::visit (AST::ExternalStaticItem &) +AttributeChecker::visit (AST::ExternalStaticItem &item) {} void -AttributeChecker::visit (AST::ExternalFunctionItem &) +AttributeChecker::visit (AST::ExternalFunctionItem &item) {} void -AttributeChecker::visit (AST::ExternBlock &) +AttributeChecker::visit (AST::ExternBlock &block) {} // rust-macro.h void -AttributeChecker::visit (AST::MacroMatchFragment &) +AttributeChecker::visit (AST::MacroMatchFragment &match) {} void -AttributeChecker::visit (AST::MacroMatchRepetition &) +AttributeChecker::visit (AST::MacroMatchRepetition &match) {} void -AttributeChecker::visit (AST::MacroMatcher &) +AttributeChecker::visit (AST::MacroMatcher &matcher) {} void -AttributeChecker::visit (AST::MacroRulesDefinition &) +AttributeChecker::visit (AST::MacroRulesDefinition &rules_def) {} void -AttributeChecker::visit (AST::MacroInvocation &) +AttributeChecker::visit (AST::MacroInvocation ¯o_invoc) {} void -AttributeChecker::visit (AST::MetaItemPath &) +AttributeChecker::visit (AST::MetaItemPath &meta_item) {} void -AttributeChecker::visit (AST::MetaItemSeq &) +AttributeChecker::visit (AST::MetaItemSeq &meta_item) {} void -AttributeChecker::visit (AST::MetaWord &) +AttributeChecker::visit (AST::MetaWord &meta_item) {} void -AttributeChecker::visit (AST::MetaNameValueStr &) +AttributeChecker::visit (AST::MetaNameValueStr &meta_item) {} void -AttributeChecker::visit (AST::MetaListPaths &) +AttributeChecker::visit (AST::MetaListPaths &meta_item) {} void -AttributeChecker::visit (AST::MetaListNameValueStr &) +AttributeChecker::visit (AST::MetaListNameValueStr &meta_item) {} // rust-pattern.h void -AttributeChecker::visit (AST::LiteralPattern &) +AttributeChecker::visit (AST::LiteralPattern &pattern) {} void -AttributeChecker::visit (AST::IdentifierPattern &) +AttributeChecker::visit (AST::IdentifierPattern &pattern) {} void -AttributeChecker::visit (AST::WildcardPattern &) +AttributeChecker::visit (AST::WildcardPattern &pattern) {} -// void AttributeChecker::visit(RangePatternBound& ){} +// void AttributeChecker::visit(RangePatternBound& bound){} void -AttributeChecker::visit (AST::RangePatternBoundLiteral &) +AttributeChecker::visit (AST::RangePatternBoundLiteral &bound) {} void -AttributeChecker::visit (AST::RangePatternBoundPath &) +AttributeChecker::visit (AST::RangePatternBoundPath &bound) {} void -AttributeChecker::visit (AST::RangePatternBoundQualPath &) +AttributeChecker::visit (AST::RangePatternBoundQualPath &bound) {} void -AttributeChecker::visit (AST::RangePattern &) +AttributeChecker::visit (AST::RangePattern &pattern) {} void -AttributeChecker::visit (AST::ReferencePattern &) +AttributeChecker::visit (AST::ReferencePattern &pattern) {} -// void AttributeChecker::visit(StructPatternField& ){} +// void AttributeChecker::visit(StructPatternField& field){} void -AttributeChecker::visit (AST::StructPatternFieldTuplePat &) +AttributeChecker::visit (AST::StructPatternFieldTuplePat &field) {} void -AttributeChecker::visit (AST::StructPatternFieldIdentPat &) +AttributeChecker::visit (AST::StructPatternFieldIdentPat &field) {} void -AttributeChecker::visit (AST::StructPatternFieldIdent &) +AttributeChecker::visit (AST::StructPatternFieldIdent &field) {} void -AttributeChecker::visit (AST::StructPattern &) +AttributeChecker::visit (AST::StructPattern &pattern) {} -// void AttributeChecker::visit(TupleStructItems& ){} +// void AttributeChecker::visit(TupleStructItems& tuple_items){} void -AttributeChecker::visit (AST::TupleStructItemsNoRange &) +AttributeChecker::visit (AST::TupleStructItemsNoRange &tuple_items) {} void -AttributeChecker::visit (AST::TupleStructItemsRange &) +AttributeChecker::visit (AST::TupleStructItemsRange &tuple_items) {} void -AttributeChecker::visit (AST::TupleStructPattern &) +AttributeChecker::visit (AST::TupleStructPattern &pattern) {} -// void AttributeChecker::visit(TuplePatternItems& ){} +// void AttributeChecker::visit(TuplePatternItems& tuple_items){} void -AttributeChecker::visit (AST::TuplePatternItemsMultiple &) +AttributeChecker::visit (AST::TuplePatternItemsMultiple &tuple_items) {} void -AttributeChecker::visit (AST::TuplePatternItemsRanged &) +AttributeChecker::visit (AST::TuplePatternItemsRanged &tuple_items) {} void -AttributeChecker::visit (AST::TuplePattern &) +AttributeChecker::visit (AST::TuplePattern &pattern) {} void -AttributeChecker::visit (AST::GroupedPattern &) +AttributeChecker::visit (AST::GroupedPattern &pattern) {} void -AttributeChecker::visit (AST::SlicePattern &) +AttributeChecker::visit (AST::SlicePattern &pattern) {} // rust-stmt.h void -AttributeChecker::visit (AST::EmptyStmt &) +AttributeChecker::visit (AST::EmptyStmt &stmt) {} void -AttributeChecker::visit (AST::LetStmt &) +AttributeChecker::visit (AST::LetStmt &stmt) {} void -AttributeChecker::visit (AST::ExprStmtWithoutBlock &) +AttributeChecker::visit (AST::ExprStmtWithoutBlock &stmt) {} void -AttributeChecker::visit (AST::ExprStmtWithBlock &) +AttributeChecker::visit (AST::ExprStmtWithBlock &stmt) {} // rust-type.h void -AttributeChecker::visit (AST::TraitBound &) +AttributeChecker::visit (AST::TraitBound &bound) {} void -AttributeChecker::visit (AST::ImplTraitType &) +AttributeChecker::visit (AST::ImplTraitType &type) {} void -AttributeChecker::visit (AST::TraitObjectType &) +AttributeChecker::visit (AST::TraitObjectType &type) {} void -AttributeChecker::visit (AST::ParenthesisedType &) +AttributeChecker::visit (AST::ParenthesisedType &type) {} void -AttributeChecker::visit (AST::ImplTraitTypeOneBound &) +AttributeChecker::visit (AST::ImplTraitTypeOneBound &type) {} void -AttributeChecker::visit (AST::TraitObjectTypeOneBound &) +AttributeChecker::visit (AST::TraitObjectTypeOneBound &type) {} void -AttributeChecker::visit (AST::TupleType &) +AttributeChecker::visit (AST::TupleType &type) {} void -AttributeChecker::visit (AST::NeverType &) +AttributeChecker::visit (AST::NeverType &type) {} void -AttributeChecker::visit (AST::RawPointerType &) +AttributeChecker::visit (AST::RawPointerType &type) {} void -AttributeChecker::visit (AST::ReferenceType &) +AttributeChecker::visit (AST::ReferenceType &type) {} void -AttributeChecker::visit (AST::ArrayType &) +AttributeChecker::visit (AST::ArrayType &type) {} void -AttributeChecker::visit (AST::SliceType &) +AttributeChecker::visit (AST::SliceType &type) {} void -AttributeChecker::visit (AST::InferredType &) +AttributeChecker::visit (AST::InferredType &type) {} void -AttributeChecker::visit (AST::BareFunctionType &) +AttributeChecker::visit (AST::BareFunctionType &type) {} } // namespace Analysis