pub type CanonicalResponse<'tcx> = Canonical<TyCtxt<'tcx>, Response<TyCtxt<'tcx>>>;
Aliased Type§
struct CanonicalResponse<'tcx> {
pub value: Response<TyCtxt<'tcx>>,
pub max_universe: UniverseIndex,
pub variables: &'tcx RawList<(), CanonicalVarInfo<TyCtxt<'tcx>>>,
}
Fields§
§value: Response<TyCtxt<'tcx>>
§max_universe: UniverseIndex
§variables: &'tcx RawList<(), CanonicalVarInfo<TyCtxt<'tcx>>>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 40 bytes
Implementations
Source§impl<I, V> Canonical<I, V>where
I: Interner,
impl<I, V> Canonical<I, V>where
I: Interner,
Sourcepub fn unchecked_map<W>(self, map_op: impl FnOnce(V) -> W) -> Canonical<I, W>
pub fn unchecked_map<W>(self, map_op: impl FnOnce(V) -> W) -> Canonical<I, W>
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<I, T> = ...;
let b: Canonical<I, (T,)> = a.unchecked_map(|v| (v, ));
An example of an incorrect use of this:
ⓘ
let a: Canonical<I, T> = ...;
let ty: Ty<I> = ...;
let b: Canonical<I, (T, Ty<I>)> = a.unchecked_map(|v| (v, ty));
Trait Implementations
Source§impl<I, V, __CTX> HashStable<__CTX> for Canonical<I, V>
impl<I, V, __CTX> HashStable<__CTX> for Canonical<I, V>
fn hash_stable( &self, __hcx: &mut __CTX, __hasher: &mut StableHasher<SipHasher128>, )
Source§impl<I, V> TypeFoldable<I> for Canonical<I, V>
impl<I, V> TypeFoldable<I> for Canonical<I, V>
Source§fn try_fold_with<__F>(
self,
__folder: &mut __F,
) -> Result<Canonical<I, V>, <__F as FallibleTypeFolder<I>>::Error>where
__F: FallibleTypeFolder<I>,
fn try_fold_with<__F>(
self,
__folder: &mut __F,
) -> Result<Canonical<I, V>, <__F as FallibleTypeFolder<I>>::Error>where
__F: FallibleTypeFolder<I>,
Source§fn fold_with<F>(self, folder: &mut F) -> Selfwhere
F: TypeFolder<I>,
fn fold_with<F>(self, folder: &mut F) -> Selfwhere
F: TypeFolder<I>,
A convenient alternative to
try_fold_with
for use with infallible
folders. Do not override this method, to ensure coherence with
try_fold_with
.