ptr: 43276834268743978
This commit is contained in:
@@ -915,12 +915,25 @@ pub struct CoercePredicate<'tcx> {
|
|||||||
}
|
}
|
||||||
pub type PolyCoercePredicate<'tcx> = ty::Binder<'tcx, CoercePredicate<'tcx>>;
|
pub type PolyCoercePredicate<'tcx> = ty::Binder<'tcx, CoercePredicate<'tcx>>;
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
pub struct Term<'tcx> {
|
pub struct Term<'tcx> {
|
||||||
ptr: NonZeroUsize,
|
ptr: NonZeroUsize,
|
||||||
marker: PhantomData<(Ty<'tcx>, Const<'tcx>)>,
|
marker: PhantomData<(Ty<'tcx>, Const<'tcx>)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Debug for Term<'_> {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
let data = if let Some(ty) = self.ty() {
|
||||||
|
format!("Term::Ty({:?})", ty)
|
||||||
|
} else if let Some(ct) = self.ct() {
|
||||||
|
format!("Term::Ct({:?})", ct)
|
||||||
|
} else {
|
||||||
|
unreachable!()
|
||||||
|
};
|
||||||
|
f.write_str(&data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'tcx> From<Ty<'tcx>> for Term<'tcx> {
|
impl<'tcx> From<Ty<'tcx>> for Term<'tcx> {
|
||||||
fn from(ty: Ty<'tcx>) -> Self {
|
fn from(ty: Ty<'tcx>) -> Self {
|
||||||
TermKind::Ty(ty).pack()
|
TermKind::Ty(ty).pack()
|
||||||
|
|||||||
Reference in New Issue
Block a user