Skip to content

mem-categorization seems to use completely bogus type for overloaded indices #20649

@nikomatsakis

Description

@nikomatsakis

While fixing an ICE, I noticed that mem-categorization is using the type of the collection (the self type) as the type of element:

let element_ty = .. {
                let ref_ty = self.overloaded_method_return_ty(method_ty);
                base_cmt = self.cat_rvalue_node(elt.id(), elt.span(), ref_ty);
                let self_ty = ty::ty_fn_sig(method_ty).input(0);
                ty::assert_no_late_bound_regions(self.tcx(), &self_ty)
}

Unless I'm being silly, this seems pretty bogus. But I didn't want to get things mixed up so I'm leaving it for now and filing a FIXME instead. Maybe I'm just confused.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions