pub fn check_legal_trait_for_method_call(
    tcx: TyCtxt<'_>,
    span: Span,
    receiver: Option<Span>,
    expr_span: Span,
    trait_id: DefId,
    body_id: DefId
) -> Result<(), ErrorGuaranteed>
Expand description

Checks that it is legal to call methods of the trait corresponding to trait_id (this only cares about the trait, not the specific method that is called).