aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/backend/rust-compile.cc')
-rw-r--r--gcc/rust/backend/rust-compile.cc18
1 files changed, 1 insertions, 17 deletions
diff --git a/gcc/rust/backend/rust-compile.cc b/gcc/rust/backend/rust-compile.cc
index 9e2c5b3..bd782b0 100644
--- a/gcc/rust/backend/rust-compile.cc
+++ b/gcc/rust/backend/rust-compile.cc
@@ -38,7 +38,6 @@ CompileCrate::~CompileCrate () {}
void
CompileCrate::Compile (HIR::Crate &crate, Context *ctx)
-
{
CompileCrate c (crate, ctx);
c.go ();
@@ -383,26 +382,11 @@ HIRCompileBase::compute_address_for_trait_item (
= self_bound->lookup_associated_item (ref->get_identifier ());
rust_assert (!associated_self_item.is_error ());
- // apply any generic arguments from this predicate
TyTy::BaseType *mono1 = associated_self_item.get_tyty_for_receiver (self);
- TyTy::BaseType *mono2 = nullptr;
- if (predicate->has_generic_args ())
- {
- mono2 = associated_self_item.get_tyty_for_receiver (
- self, predicate->get_generic_args ());
- }
- else
- {
- mono2 = associated_self_item.get_tyty_for_receiver (self);
- }
rust_assert (mono1 != nullptr);
rust_assert (mono1->get_kind () == TyTy::TypeKind::FNDEF);
TyTy::FnType *assocated_item_ty1 = static_cast<TyTy::FnType *> (mono1);
- rust_assert (mono2 != nullptr);
- rust_assert (mono2->get_kind () == TyTy::TypeKind::FNDEF);
- TyTy::FnType *assocated_item_ty2 = static_cast<TyTy::FnType *> (mono2);
-
// Lookup the impl-block for the associated impl_item if it exists
HIR::Function *associated_function = nullptr;
for (auto &impl_item : associated_impl_block->get_impl_items ())
@@ -434,7 +418,7 @@ HIRCompileBase::compute_address_for_trait_item (
{
TyTy::SubstitutionArgumentMappings mappings
= assocated_item_ty1->solve_missing_mappings_from_this (
- *assocated_item_ty2, *lookup_fntype);
+ *trait_item_fntype, *lookup_fntype);
lookup_fntype = lookup_fntype->handle_substitions (mappings);
}