Struct rustc::middle::typeck::infer::InferCtxtExperimental [-]  [+] [src]

pub struct InferCtxt<'a, 'tcx> {
    pub tcx: &'a ctxt<'tcx>,
    // some fields omitted
}

Fields

tcx

Methods

impl<'a, 'tcx> InferCtxt<'a, 'tcx>

fn skolemize<T: TypeFoldable>(&self, t: T) -> T

fn type_var_diverges(&'a self, ty: t) -> bool

fn skolemizer<'a>(&'a self) -> TypeSkolemizer<'a, 'tcx>

fn combine_fields<'a>(&'a self, a_is_expected: bool, trace: TypeTrace) -> CombineFields<'a, 'tcx>

fn equate<'a>(&'a self, a_is_expected: bool, trace: TypeTrace) -> Equate<'a, 'tcx>

fn sub<'a>(&'a self, a_is_expected: bool, trace: TypeTrace) -> Sub<'a, 'tcx>

fn lub<'a>(&'a self, a_is_expected: bool, trace: TypeTrace) -> Lub<'a, 'tcx>

fn commit_unconditionally<R>(&self, f: || -> R) -> R

Execute f and commit the bindings

fn commit_if_ok<T, E>(&self, f: || -> Result<T, E>) -> Result<T, E>

Execute f and commit the bindings if successful

fn try<T, E>(&self, f: || -> Result<T, E>) -> Result<T, E>

Execute f, unroll bindings on panic

fn probe<R>(&self, f: || -> R) -> R

Execute f then unroll any bindings it creates

fn add_given(&self, sub: FreeRegion, sup: RegionVid)

fn sub_types(&self, a_is_expected: bool, origin: TypeOrigin, a: t, b: t) -> ures

fn eq_types(&self, a_is_expected: bool, origin: TypeOrigin, a: t, b: t) -> ures

fn sub_trait_refs(&self, a_is_expected: bool, origin: TypeOrigin, a: Rc<TraitRef>, b: Rc<TraitRef>) -> ures

impl<'a, 'tcx> InferCtxt<'a, 'tcx>

fn next_ty_var_id(&self, diverging: bool) -> TyVid

fn next_ty_var(&self) -> t

fn next_diverging_ty_var(&self) -> t

fn next_ty_vars(&self, n: uint) -> Vec<t>

fn next_int_var_id(&self) -> IntVid

fn next_float_var_id(&self) -> FloatVid

fn next_region_var(&self, origin: RegionVariableOrigin) -> Region

fn region_vars_for_defs(&self, span: Span, defs: &[RegionParameterDef]) -> Vec<Region>

fn fresh_substs_for_generics(&self, span: Span, generics: &Generics) -> Substs

Given a set of generics defined on a type or impl, returns a substitution mapping each type/region parameter to a fresh inference variable.

fn fresh_substs_for_trait(&self, span: Span, generics: &Generics, self_ty: t) -> Substs

Given a set of generics defined on a trait, returns a substitution mapping each output type/region parameter to a fresh inference variable, and mapping the self type to self_ty.

fn fresh_bound_region(&self, binder_id: NodeId) -> Region

fn resolve_regions_and_report_errors(&self)

fn ty_to_string(&self, t: t) -> String

fn tys_to_string(&self, ts: &[t]) -> String

fn trait_ref_to_string(&self, t: &TraitRef) -> String

fn contains_unbound_type_variables(&self, typ: t) -> t

fn shallow_resolve(&self, typ: t) -> t

fn resolve_type_vars_if_possible(&self, typ: t) -> t

fn resolve_type_vars_in_trait_ref_if_possible(&self, trait_ref: &TraitRef) -> TraitRef

fn type_error_message_str(&self, sp: Span, mk_msg: |Option<String>, String| -> String, actual_ty: String, err: Option<&type_err>)

fn type_error_message_str_with_expected(&self, sp: Span, mk_msg: |Option<String>, String| -> String, expected_ty: Option<t>, actual_ty: String, err: Option<&type_err>)

fn type_error_message(&self, sp: Span, mk_msg: |String| -> String, actual_ty: t, err: Option<&type_err>)

fn report_mismatched_types(&self, span: Span, expected: t, actual: t, err: &type_err)

fn replace_late_bound_regions_with_fresh_regions(&self, trace: TypeTrace, fsig: &FnSig) -> (FnSig, HashMap<BoundRegion, Region>)

Trait Implementations

impl<'a, 'tcx> RegionScope for InferCtxt<'a, 'tcx>

fn default_region_bound(&self, span: Span) -> Option<Region>

fn anon_regions(&self, span: Span, count: uint) -> Result<Vec<Region>, Option<Vec<(String, uint)>>>

impl<'a, 'tcx> ErrorReporting for InferCtxt<'a, 'tcx>

fn report_region_errors(&self, errors: &Vec<RegionResolutionError>)

fn process_errors(&self, errors: &Vec<RegionResolutionError>) -> Vec<RegionResolutionError>

fn report_type_error(&self, trace: TypeTrace, terr: &type_err)

fn report_and_explain_type_error(&self, trace: TypeTrace, terr: &type_err)

fn values_str(&self, values: &ValuePairs) -> Option<String>

Returns a string of the form "expected {}, found {}", or None if this is a derived error.

fn expected_found_str<T: UserString + Resolvable>(&self, exp_found: &expected_found<T>) -> Option<String>

fn report_param_bound_failure(&self, origin: SubregionOrigin, param_ty: ParamTy, sub: Region, _sups: Vec<Region>)

fn report_concrete_failure(&self, origin: SubregionOrigin, sub: Region, sup: Region)

fn report_sub_sup_conflict(&self, var_origin: RegionVariableOrigin, sub_origin: SubregionOrigin, sub_region: Region, sup_origin: SubregionOrigin, sup_region: Region)

fn report_sup_sup_conflict(&self, var_origin: RegionVariableOrigin, origin1: SubregionOrigin, region1: Region, origin2: SubregionOrigin, region2: Region)

fn report_processed_errors(&self, var_origins: &[RegionVariableOrigin], trace_origins: &[(TypeTrace, type_err)], same_regions: &[SameRegions])

fn give_suggestion(&self, same_regions: &[SameRegions])

impl<'a, 'tcx, V: SimplyUnifiable, K: UnifyKey<Option<V>>> InferCtxtMethodsForSimplyUnifiableTypes<V, K> for InferCtxt<'a, 'tcx>

fn simple_vars(&self, a_is_expected: bool, a_id: K, b_id: K) -> ures

Unifies two simple keys. Because simple keys do not have any subtyping relationships, if both keys have already been associated with a value, then those two values must be the same.

fn simple_var_t(&self, a_is_expected: bool, a_id: K, b: V) -> ures

Sets the value of the key a_id to b. Because simple keys do not have any subtyping relationships, if a_id already has a value, it must be the same as b.

fn probe_var(&self, a_id: K) -> Option<t>