Uplift ClauseKind and PredicateKind
This commit is contained in:
parent
249624b504
commit
573f475853
15 changed files with 735 additions and 217 deletions
|
@ -199,43 +199,6 @@ impl<'tcx> fmt::Debug for ty::Clause<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'tcx> fmt::Debug for ty::ClauseKind<'tcx> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match *self {
|
||||
ty::ClauseKind::ConstArgHasType(ct, ty) => write!(f, "ConstArgHasType({ct:?}, {ty:?})"),
|
||||
ty::ClauseKind::Trait(ref a) => a.fmt(f),
|
||||
ty::ClauseKind::RegionOutlives(ref pair) => pair.fmt(f),
|
||||
ty::ClauseKind::TypeOutlives(ref pair) => pair.fmt(f),
|
||||
ty::ClauseKind::Projection(ref pair) => pair.fmt(f),
|
||||
ty::ClauseKind::WellFormed(ref data) => write!(f, "WellFormed({data:?})"),
|
||||
ty::ClauseKind::ConstEvaluatable(ct) => {
|
||||
write!(f, "ConstEvaluatable({ct:?})")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> fmt::Debug for ty::PredicateKind<'tcx> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match *self {
|
||||
ty::PredicateKind::Clause(ref a) => a.fmt(f),
|
||||
ty::PredicateKind::Subtype(ref pair) => pair.fmt(f),
|
||||
ty::PredicateKind::Coerce(ref pair) => pair.fmt(f),
|
||||
ty::PredicateKind::ObjectSafe(trait_def_id) => {
|
||||
write!(f, "ObjectSafe({trait_def_id:?})")
|
||||
}
|
||||
ty::PredicateKind::ClosureKind(closure_def_id, closure_args, kind) => {
|
||||
write!(f, "ClosureKind({closure_def_id:?}, {closure_args:?}, {kind:?})")
|
||||
}
|
||||
ty::PredicateKind::ConstEquate(c1, c2) => write!(f, "ConstEquate({c1:?}, {c2:?})"),
|
||||
ty::PredicateKind::Ambiguous => write!(f, "Ambiguous"),
|
||||
ty::PredicateKind::AliasRelate(t1, t2, dir) => {
|
||||
write!(f, "AliasRelate({t1:?}, {dir:?}, {t2:?})")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> fmt::Debug for AliasTy<'tcx> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
OptWithInfcx::new_no_ctx(self).fmt(f)
|
||||
|
@ -518,7 +481,6 @@ TrivialTypeTraversalAndLiftImpls! {
|
|||
::rustc_hir::Mutability,
|
||||
::rustc_hir::Unsafety,
|
||||
::rustc_target::spec::abi::Abi,
|
||||
crate::ty::AliasRelationDirection,
|
||||
crate::ty::ClosureKind,
|
||||
crate::ty::ParamConst,
|
||||
crate::ty::ParamTy,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue