mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
ptr: 43276834268743978
This commit is contained in:
parent
87788097b7
commit
ef36af2f9d
@ -915,12 +915,25 @@ pub struct 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> {
|
||||
ptr: NonZeroUsize,
|
||||
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> {
|
||||
fn from(ty: Ty<'tcx>) -> Self {
|
||||
TermKind::Ty(ty).pack()
|
||||
|
Loading…
Reference in New Issue
Block a user