? SubstMapperInternal::Resolve (associated_self, infer_arguments)
: associated_self;
- // FIXME this needs to do a lookup for the trait-reference DefId instead of
- // assuming its the first one in the list
- rust_assert (associated_self->num_specified_bounds () > 0);
- TyTy::TypeBoundPredicate &impl_predicate
- = associated_self->get_specified_bounds ().at (0);
+ const TyTy::TypeBoundPredicate &impl_predicate
+ = associated_self->lookup_predicate (bound.get_id ());
+ rust_assert (!impl_predicate.is_error ());
// infer the arguments on the predicate
std::vector<TyTy::BaseType *> impl_trait_predicate_args;