trait_ref_is_knowable in rustc_next_trait_solver::coherence - Rust
Description: Returns whether all impls which would apply to the `trait_ref` e.g. `Ty: Trait<Arg>` are already known in the local crate.

Skip to main content

## trait_ref_is_knowable

# Function trait_ref_is_knowable

Source

    pub fn trait_ref_is_knowable<Infcx, I, E>(
        infcx: &Infcx,
        trait_ref: TraitRef<I>,
        lazily_normalize_ty: impl FnMut(I::Ty) -> Result<I::Ty, E>,
    ) -> Result<Result<(), Conflict>, E>where
        Infcx: InferCtxtLike<Interner = I>,
        I: Interner,
        E: Debug,

Expand description

Returns whether all impls which would apply to the `trait_ref` e.g. `Ty: Trait<Arg>` are already known in the local crate.

This both checks whether any downstream or sibling crates could implement it and whether an upstream crate can add this impl without breaking backwards compatibility.