Skip to main content

specializes_query

Function specializes_query 

Source
fn specializes_query<'db>(
    db: &'db dyn HirDatabase,
    specializing_impl_def_id: ImplId,
    parent_impl_def_id: ImplId,
) -> bool
Expand description

Is specializing_impl_def_id a specialization of parent_impl_def_id?

For every type that could apply to specializing_impl_def_id, we prove that the parent_impl_def_id also applies (i.e. it has a valid impl header and its where-clauses hold).

For the purposes of const traits, we also check that the specializing impl is not more restrictive than the parent impl. That is, if the parent_impl_def_id is a const impl (conditionally based off of some [const] bounds), then specializing_impl_def_id must also be const for the same set of types.