Module rustc_trait_selection::traits::coherence [−][src]
Expand description
See Rustc Dev Guide chapters on trait-resolution and trait-specialization for more info on how this works.
Structs
Enums
Whether we do the orphan check relative to this crate or to some remote crate.
Functions
Returns a list of relevant non-local types for ty
.
For #[fundamental]
ADTs and &T
/ &mut T
, returns Some
with the
type parameters of the ADT, or T
, respectively. For non-fundamental
types, returns None
.
Checks the coherence orphan rules. impl_def_id
should be the
DefId
of a trait impl. To pass, either the trait must be local, or else
two conditions must be satisfied:
Checks whether a trait-ref is potentially implementable by a crate.
Can both impl a
and impl b
be satisfied by a common type (including
where-clauses)? If so, returns an ImplHeader
that unifies the two impls.
If there are types that satisfy both impls, invokes on_overlap
with a suitably-freshened ImplHeader
with those types
substituted. Otherwise, invokes no_overlap
.