ra-ap-rustc_type_ir 0.147.0

Automatically published version of the package `rustc_type_ir` in the rust-lang/rust repository from commit 9bc8b40bc314b74e1d5e5ab21a0df39c55a34806 The publishing script for this crate lives at: https://github.com/rust-analyzer/rustc-auto-publish
Documentation
/// A trait implemented for all `X<'a>` types that can be safely and
/// efficiently converted to `X<'tcx>` as long as they are part of the
/// provided `TyCtxt<'tcx>`.
/// This can be done, for example, for `Ty<'tcx>` or `GenericArgsRef<'tcx>`
/// by looking them up in their respective interners.
///
/// However, this is still not the best implementation as it does
/// need to compare the components, even for interned values.
/// It would be more efficient if `TypedArena` provided a way to
/// determine whether the address is in the allocated range.
///
/// `None` is returned if the value or one of the components is not part
/// of the provided context.
/// For `Ty`, `None` can be returned if either the type interner doesn't
/// contain the `TyKind` key or if the address of the interned
/// pointer differs. The latter case is possible if a primitive type,
/// e.g., `()` or `u8`, was interned in a different context.
pub trait Lift<I>: std::fmt::Debug {
    type Lifted: std::fmt::Debug;
    fn lift_to_interner(self, cx: I) -> Option<Self::Lifted>;
}