[−][src]Struct rustc_infer::infer::combine::CombineFields
Fields
infcx: &'infcx InferCtxt<'infcx, 'tcx>trace: TypeTrace<'tcx>cause: Option<Cause>param_env: ParamEnv<'tcx>obligations: PredicateObligations<'tcx>Implementations
impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx>[src]
pub fn tcx(&self) -> TyCtxt<'tcx>[src]
pub fn equate<'a>(&'a mut self, a_is_expected: bool) -> Equate<'a, 'infcx, 'tcx>[src]
pub fn sub<'a>(&'a mut self, a_is_expected: bool) -> Sub<'a, 'infcx, 'tcx>[src]
pub fn lub<'a>(&'a mut self, a_is_expected: bool) -> Lub<'a, 'infcx, 'tcx>[src]
pub fn glb<'a>(&'a mut self, a_is_expected: bool) -> Glb<'a, 'infcx, 'tcx>[src]
pub fn instantiate(
&mut self,
a_ty: Ty<'tcx>,
dir: RelationDir,
b_vid: TyVid,
a_is_expected: bool
) -> RelateResult<'tcx, ()>[src]
&mut self,
a_ty: Ty<'tcx>,
dir: RelationDir,
b_vid: TyVid,
a_is_expected: bool
) -> RelateResult<'tcx, ()>
Here, dir is either EqTo, SubtypeOf, or SupertypeOf.
The idea is that we should ensure that the type a_ty is equal
to, a subtype of, or a supertype of (respectively) the type
to which b_vid is bound.
Since b_vid has not yet been instantiated with a type, we
will first instantiate b_vid with a generalized version
of a_ty. Generalization introduces other inference
variables wherever subtyping could occur.
pub(in infer::combine) fn generalize(
&self,
ty: Ty<'tcx>,
for_vid: TyVid,
dir: RelationDir
) -> RelateResult<'tcx, Generalization<'tcx>>[src]
&self,
ty: Ty<'tcx>,
for_vid: TyVid,
dir: RelationDir
) -> RelateResult<'tcx, Generalization<'tcx>>
Attempts to generalize ty for the type variable for_vid.
This checks for cycle -- that is, whether the type ty
references for_vid. The dir is the "direction" for which we
a performing the generalization (i.e., are we producing a type
that can be used as a supertype etc).
Preconditions:
for_vidis a "root vid"
pub fn add_const_equate_obligation(
&mut self,
a_is_expected: bool,
a: &'tcx Const<'tcx>,
b: &'tcx Const<'tcx>
)[src]
&mut self,
a_is_expected: bool,
a: &'tcx Const<'tcx>,
b: &'tcx Const<'tcx>
)
impl<'a, 'tcx> CombineFields<'a, 'tcx>[src]
pub fn higher_ranked_sub<T>(
&mut self,
a: Binder<T>,
b: Binder<T>,
a_is_expected: bool
) -> RelateResult<'tcx, Binder<T>> where
T: Relate<'tcx>, [src]
&mut self,
a: Binder<T>,
b: Binder<T>,
a_is_expected: bool
) -> RelateResult<'tcx, Binder<T>> where
T: Relate<'tcx>,
Trait Implementations
impl<'infcx, 'tcx> Clone for CombineFields<'infcx, 'tcx>[src]
pub fn clone(&self) -> CombineFields<'infcx, 'tcx>[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
Auto Trait Implementations
impl<'infcx, 'tcx> !RefUnwindSafe for CombineFields<'infcx, 'tcx>
impl<'infcx, 'tcx> !Send for CombineFields<'infcx, 'tcx>
impl<'infcx, 'tcx> !Sync for CombineFields<'infcx, 'tcx>
impl<'infcx, 'tcx> Unpin for CombineFields<'infcx, 'tcx> where
'tcx: 'infcx,
'tcx: 'infcx,
impl<'infcx, 'tcx> !UnwindSafe for CombineFields<'infcx, 'tcx>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.