rustc_trait_selection::traits::select::confirmation

Function pointer_like_goal_for_rpitit

Source
fn pointer_like_goal_for_rpitit<'tcx>(
    tcx: TyCtxt<'tcx>,
    supertrait: PolyTraitRef<'tcx>,
    rpitit_item: DefId,
    cause: &ObligationCause<'tcx>,
) -> PolyTraitRef<'tcx>
Expand description

Compute a goal that some RPITIT (right now, only RPITITs corresponding to Futures) implements the PointerLike trait, which is a requirement for the RPITIT to be coercible to dyn* Future, which is itself a requirement for the RPITIT’s parent trait to be coercible to dyn Trait.

We do this given a supertrait’s substitutions, and then augment the substitutions with bound variables to compute the goal universally. Given that PointerLike has no region requirements (at least for the built-in pointer types), this shouldn’t really matter, but it is the best choice for soundness.