aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile.cc
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-12-04 15:27:26 +0000
committerPhilip Herron <philip.herron@embecosm.com>2022-12-04 15:27:26 +0000
commit9da783d1b71bb5e8add0cf74527786d0e4255803 (patch)
tree3875dd8ee1757432a8aac855118a12ce748e2f21 /gcc/rust/backend/rust-compile.cc
parent0bf68cf5e6199ce7deb3d0744ced09dd4db1b1c9 (diff)
downloadgcc-9da783d1b71bb5e8add0cf74527786d0e4255803.zip
gcc-9da783d1b71bb5e8add0cf74527786d0e4255803.tar.gz
gcc-9da783d1b71bb5e8add0cf74527786d0e4255803.tar.bz2
Revert "rust: Remove unused variables and fix dangling references"
This reverts commit 9657c328d0cdda49b7985c3ee727781a387e128b.
Diffstat (limited to 'gcc/rust/backend/rust-compile.cc')
-rw-r--r--gcc/rust/backend/rust-compile.cc12
1 files changed, 5 insertions, 7 deletions
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<std::pair<Resolver::TraitReference *, HIR::ImplBlock *>>
&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);