pub struct Unnormalized<I: Interner, T> {
value: T,
_tcx: PhantomData<fn() -> I>,
}Expand description
A wrapper for values that need normalization.
FIXME(#155345): This is very WIP. The plan is to replace the skip_norm_wip
spread throughout the codebase with proper normalization. This is the first
step toward switching to eager normalization with the next solver. See the
normalization refactor plan here.
We’re in a weird intermediate state as the change is too big to land in a
single PR. While this work is in progress, just use Unnormalized::new_wip
and Unnormalized::skip_norm_wip as needed.
The interner type parameter exists to constraint generic for certain impl,
e.g., Unnormalized<I, I::Clause>.
Fields§
§value: T§_tcx: PhantomData<fn() -> I>Implementations§
Source§impl<I: Interner, T> Unnormalized<I, T>
impl<I: Interner, T> Unnormalized<I, T>
Sourcepub fn new(value: T) -> Unnormalized<I, T>
pub fn new(value: T) -> Unnormalized<I, T>
Should only be used in limited situations where you produce an potentially unnormalized value, like in (Early)Binder/GenericPredicates instantiation.
Sourcepub fn new_wip(value: T) -> Unnormalized<I, T>
pub fn new_wip(value: T) -> Unnormalized<I, T>
FIXME: This is going to be eventually removed once we migrate the relevant
APIs to return Unnormalized.
Sourcepub fn skip_normalization(self) -> T
pub fn skip_normalization(self) -> T
Intentionally skip normalization. You probably should perform normalization in most cases.
Sourcepub fn skip_norm_wip(self) -> T
pub fn skip_norm_wip(self) -> T
FIXME: This is going to be eventually removed.
If you meet this in codebase, try using one of the normalization routines
to consume the Unnormalized wrapper. Or use skip_normalization when normalization
is really unnecessary.
pub fn map<F, U>(self, f: F) -> Unnormalized<I, U>where
F: FnOnce(T) -> U,
pub fn as_ref(&self) -> Unnormalized<I, &T>
pub fn map_ref<U, F>(&self, f: F) -> Unnormalized<I, U>
Source§impl<I: Interner, T, U> Unnormalized<I, (T, U)>
impl<I: Interner, T, U> Unnormalized<I, (T, U)>
pub fn unzip(self) -> (Unnormalized<I, T>, Unnormalized<I, U>)
Source§impl<I: Interner, T> Unnormalized<I, Binder<I, T>>
impl<I: Interner, T> Unnormalized<I, Binder<I, T>>
pub fn skip_binder(self) -> T
Source§impl<I: Interner> Unnormalized<I, I::Clause>
impl<I: Interner> Unnormalized<I, I::Clause>
pub fn as_trait_clause( self, ) -> Option<Unnormalized<I, Binder<I, TraitPredicate<I>>>>
pub fn kind(self) -> Unnormalized<I, Binder<I, ClauseKind<I>>>
Source§impl<I: Interner> Unnormalized<I, Binder<I, TraitPredicate<I>>>
impl<I: Interner> Unnormalized<I, Binder<I, TraitPredicate<I>>>
Source§impl<I: Interner> Unnormalized<I, Binder<I, TraitRef<I>>>
impl<I: Interner> Unnormalized<I, Binder<I, TraitRef<I>>>
pub fn self_ty(&self) -> Unnormalized<I, Binder<I, I::Ty>>
pub fn def_id(&self) -> I::TraitId
pub fn to_host_effect_clause( self, cx: I, constness: BoundConstness, ) -> Unnormalized<I, I::Clause>
Trait Implementations§
Source§impl<I: Interner, T> PartialOrd for Unnormalized<I, T>where
T: PartialOrd,
impl<I: Interner, T> PartialOrd for Unnormalized<I, T>where
T: PartialOrd,
impl<I: Interner, T> Copy for Unnormalized<I, T>where
T: Copy,
Auto Trait Implementations§
impl<I, T> DynSend for Unnormalized<I, T>where
T: DynSend,
impl<I, T> DynSync for Unnormalized<I, T>where
T: DynSync,
impl<I, T> Freeze for Unnormalized<I, T>where
T: Freeze,
impl<I, T> RefUnwindSafe for Unnormalized<I, T>where
T: RefUnwindSafe,
impl<I, T> Send for Unnormalized<I, T>where
T: Send,
impl<I, T> Sync for Unnormalized<I, T>where
T: Sync,
impl<I, T> Unpin for Unnormalized<I, T>where
T: Unpin,
impl<I, T> UnsafeUnpin for Unnormalized<I, T>where
T: UnsafeUnpin,
impl<I, T> UnwindSafe for Unnormalized<I, T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.