aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile.cc
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-11-15 16:16:01 +0000
committerGitHub <noreply@github.com>2022-11-15 16:16:01 +0000
commit4c565999541c60ac5d1b5af618963e701b384fdd (patch)
treefca6e243cd4901ff8847206ab25ebb5dde10bb91 /gcc/rust/backend/rust-compile.cc
parent815a57351a33491e534cc1b6c6ddfa17eaf2b500 (diff)
parent9657c328d0cdda49b7985c3ee727781a387e128b (diff)
downloadgcc-4c565999541c60ac5d1b5af618963e701b384fdd.zip
gcc-4c565999541c60ac5d1b5af618963e701b384fdd.tar.gz
gcc-4c565999541c60ac5d1b5af618963e701b384fdd.tar.bz2
Merge #1635
1635: rust: Remove unused variables and fix dangling references r=CohenArthur a=CohenArthur This should make the bootstrap build green again. This commit contains some aggressive refactoring which either removes unused arguments altogether or removes the argument name in some cases where it might get used later on or cannot change due to implementing a virtual method or something like that. Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Diffstat (limited to 'gcc/rust/backend/rust-compile.cc')
-rw-r--r--gcc/rust/backend/rust-compile.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/rust/backend/rust-compile.cc b/gcc/rust/backend/rust-compile.cc
index 0c72a16..1f97ad1 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, actual, locus);
+ 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 *receiver, const TyTy::BaseType *root, Location locus)
+ 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,9 +360,11 @@ HIRCompileBase::compute_address_for_trait_item (
}
bool
-HIRCompileBase::verify_array_capacities (tree ltype, tree rtype,
- Location lvalue_locus,
- Location rvalue_locus)
+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)
{
rust_assert (ltype != NULL_TREE);
rust_assert (rtype != NULL_TREE);