[−][src]Struct rustc_trait_selection::infer::canonical::Canonical
A "canonicalized" type V is one where all free inference
variables have been rewritten to "canonical vars". These are
numbered starting from 0 in order of first appearance.
Fields
max_universe: UniverseIndexvariables: &'tcx List<CanonicalVarInfo>value: VImplementations
impl<'tcx, R> Canonical<'tcx, QueryResponse<'tcx, R>>[src]
impl<'tcx, V> Canonical<'tcx, V>[src]
pub fn unchecked_map<W>(self, map_op: impl FnOnce(V) -> W) -> Canonical<'tcx, W>[src]
Allows you to map the value of a canonical while keeping the
same set of bound variables.
WARNING: This function is very easy to mis-use, hence the
name! In particular, the new value W must use all the
same type/region variables in precisely the same order
as the original! (The ordering is defined by the
TypeFoldable implementation of the type in question.)
An example of a correct use of this:
let a: Canonical<'_, T> = ...; let b: Canonical<'_, (T,)> = a.unchecked_map(|v| (v, ));
An example of an incorrect use of this:
let a: Canonical<'tcx, T> = ...; let ty: Ty<'tcx> = ...; let b: Canonical<'tcx, (T, Ty<'tcx>)> = a.unchecked_map(|v| (v, ty));
impl<'tcx> Canonical<'tcx, UserType<'tcx>>[src]
pub fn is_identity(&self) -> bool[src]
Returns true if this represents a substitution of the form [?0, ?1, ?2],
i.e., each thing is mapped to a canonical variable with the same index.
Trait Implementations
impl<'tcx, V> Clone for Canonical<'tcx, V> where
V: Clone, [src]
V: Clone,
impl<'tcx, V> Copy for Canonical<'tcx, V> where
V: Copy, [src]
V: Copy,
impl<'tcx, V> Debug for Canonical<'tcx, V> where
V: Debug, [src]
V: Debug,
impl<'tcx, V> Eq for Canonical<'tcx, V> where
V: Eq, [src]
V: Eq,
impl<'tcx, V> Hash for Canonical<'tcx, V> where
V: Hash, [src]
V: Hash,
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher, [src]
__H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl<'tcx, V> PartialEq<Canonical<'tcx, V>> for Canonical<'tcx, V> where
V: PartialEq<V>, [src]
V: PartialEq<V>,
Auto Trait Implementations
impl<'tcx, V> !RefUnwindSafe for Canonical<'tcx, V>
impl<'tcx, V> Send for Canonical<'tcx, V> where
V: Send,
V: Send,
impl<'tcx, V> Sync for Canonical<'tcx, V> where
V: Sync,
V: Sync,
impl<'tcx, V> Unpin for Canonical<'tcx, V> where
V: Unpin,
V: Unpin,
impl<'tcx, V> !UnwindSafe for Canonical<'tcx, V>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<'tcx, T> ArenaAllocatable<'tcx, ()> for T where
T: Copy, [src]
T: Copy,
fn allocate_on(self, arena: &'a Arena<'tcx>) -> &'a mut T[src]
fn allocate_from_iter(
arena: &'a Arena<'tcx>,
iter: impl IntoIterator<Item = T>
) -> &'a mut [T][src]
arena: &'a Arena<'tcx>,
iter: impl IntoIterator<Item = T>
) -> &'a mut [T]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<'tcx, T> Subst<'tcx> for T where
T: TypeFoldable<'tcx>, [src]
T: TypeFoldable<'tcx>,
fn subst_spanned(
&self,
tcx: TyCtxt<'tcx>,
substs: &[GenericArg<'tcx>],
span: Option<Span>
) -> T[src]
&self,
tcx: TyCtxt<'tcx>,
substs: &[GenericArg<'tcx>],
span: Option<Span>
) -> T
fn subst(&self, tcx: TyCtxt<'tcx>, substs: &[GenericArg<'tcx>]) -> Self[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
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.
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.