trait_predicate_with_def_id in rustc_next_trait_solver::solve::trait_goals - Rust
Description: Small helper function to change the `def_id` of a trait predicate - this is not normally something that you want to do, as different traits will require different args and so making it easy to change the trait is something of a footgun, but it is useful in the narrow circumstance of changing from `MetaSized` to `Sized`, which happens as part of the lazy elaboration of sizedness candidates.

Skip to main content

## trait_predicate_with_def_id

# Function trait_predicate_with_def_id

Source

    fn trait_predicate_with_def_id<I: Interner>(
        cx: I,
        clause: Binder<I, TraitPredicate<I>>,
        did: I::TraitId,
    ) -> I::Clause

Expand description

Small helper function to change the `def_id` of a trait predicate - this is not normally something that you want to do, as different traits will require different args and so making it easy to change the trait is something of a footgun, but it is useful in the narrow circumstance of changing from `MetaSized` to `Sized`, which happens as part of the lazy elaboration of sizedness candidates.