Trait QueryNormalizeExt

Source
pub trait QueryNormalizeExt<'tcx> {
    // Required method
    fn query_normalize<T>(
        self,
        value: T,
    ) -> Result<Normalized<'tcx, T>, NoSolution>
       where T: TypeFoldable<TyCtxt<'tcx>>;
}

Required Methods§

Source

fn query_normalize<T>(self, value: T) -> Result<Normalized<'tcx, T>, NoSolution>
where T: TypeFoldable<TyCtxt<'tcx>>,

Normalize value in the context of the inference context, yielding a resulting type, or an error if value cannot be normalized. If you don’t care about regions, you should prefer normalize_erasing_regions, which is more efficient.

If the normalization succeeds, returns back the normalized value along with various outlives relations (in the form of obligations that must be discharged).

This normalization should only be used when the projection is well-formed and does not have possible ambiguity (contains inference variables).

After codegen, when lifetimes do not matter, it is preferable to instead use TyCtxt::normalize_erasing_regions, which wraps this procedure.

N.B. Once the new solver is stabilized this method of normalization will likely be removed as trait solver operations are already cached by the query system making this redundant.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, 'tcx> QueryNormalizeExt<'tcx> for At<'a, 'tcx>