Module rustc::traits::coherence[][src]

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

See rustc guide chapters on trait-resolution and trait-specialization for more info on how this works.

Re-exports

use hir::def_id::DefId;
use hir::def_id::LOCAL_CRATE;
use syntax_pos::DUMMY_SP;
use traits;
use traits::Normalized;
use traits::SelectionContext;
use traits::Obligation;
use traits::ObligationCause;
use traits::IntercrateMode;
use traits::select::IntercrateAmbiguityCause;
use ty;
use ty::Ty;
use ty::TyCtxt;
use ty::fold::TypeFoldable;
use ty::subst::Subst;
use infer::InferOk;

Structs

OverlapResult [
Experimental
]

Enums

Conflict [
Experimental
]
InCrate [
Experimental
]

Whether we do the orphan check relative to this crate or to some remote crate.

OrphanCheckErr [
Experimental
]

Functions

def_id_is_local [
Experimental
]
fundamental_ty [
Experimental
]
is_possibly_remote_type [
Experimental
]
orphan_check [
Experimental
]

Checks the coherence orphan rules. impl_def_id should be the def-id of a trait impl. To pass, either the trait must be local, or else two conditions must be satisfied:

orphan_check_trait_ref [
Experimental
]

Check whether a trait-ref is potentially implementable by a crate.

overlap [
Experimental
]

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.

overlapping_impls [
Experimental
]

If there are types that satisfy both impls, invokes on_overlap with a suitably-freshened ImplHeader with those types substituted. Otherwise, invokes no_overlap.

trait_ref_is_knowable [
Experimental
]
trait_ref_is_local_or_fundamental [
Experimental
]
ty_is_local [
Experimental
]
ty_is_local_constructor [
Experimental
]
uncovered_tys [
Experimental
]
with_fresh_ty_vars [
Experimental
]