rustc_trait_selection::traits::query::normalize

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 and is unambiguous, returns back the normalized value along with various outlives relations (in the form of obligations that must be discharged).

N.B., this will eventually be the main means of normalizing, but for now should be used only when we actually know that normalization will succeed, since error reporting and other details are still “under development”.

This normalization should only be used when the projection does not have possible ambiguity or may not be well-formed.

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

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>