From 9da783d1b71bb5e8add0cf74527786d0e4255803 Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Sun, 4 Dec 2022 15:27:26 +0000 Subject: Revert "rust: Remove unused variables and fix dangling references" This reverts commit 9657c328d0cdda49b7985c3ee727781a387e128b. --- gcc/rust/backend/rust-compile.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'gcc/rust/backend/rust-compile.cc') diff --git a/gcc/rust/backend/rust-compile.cc b/gcc/rust/backend/rust-compile.cc index 1f97ad1..0c72a16 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); -- cgit v1.1