Printing alias-relate goals correctly
This commit is contained in:
parent
3a36a093dd
commit
f6fd754680
3 changed files with 14 additions and 4 deletions
|
@ -661,6 +661,16 @@ impl AliasRelationDirection {
|
|||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for AliasRelationDirection {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
AliasRelationDirection::Equate => write!(f, " == "),
|
||||
AliasRelationDirection::Subtype => write!(f, " <: "),
|
||||
AliasRelationDirection::Supertype => write!(f, " :> "),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The crate outlives map is computed during typeck and contains the
|
||||
/// outlives of every item in the local crate. You should not use it
|
||||
/// directly, because to do so will make your pass dependent on the
|
||||
|
|
|
@ -2847,8 +2847,7 @@ define_print_and_forward_display! {
|
|||
p!("the type `", print(ty), "` is found in the environment")
|
||||
}
|
||||
ty::PredicateKind::Ambiguous => p!("ambiguous"),
|
||||
// TODO
|
||||
ty::PredicateKind::AliasRelate(t1, t2, _) => p!(print(t1), " == ", print(t2)),
|
||||
ty::PredicateKind::AliasRelate(t1, t2, dir) => p!(print(t1), write(" {} ", dir), print(t2)),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -177,8 +177,9 @@ impl<'tcx> fmt::Debug for ty::PredicateKind<'tcx> {
|
|||
write!(f, "TypeWellFormedFromEnv({:?})", ty)
|
||||
}
|
||||
ty::PredicateKind::Ambiguous => write!(f, "Ambiguous"),
|
||||
// TODO
|
||||
ty::PredicateKind::AliasRelate(t1, t2, _) => write!(f, "AliasRelate({t1:?}, {t2:?})"),
|
||||
ty::PredicateKind::AliasRelate(t1, t2, dir) => {
|
||||
write!(f, "AliasRelate({t1:?}, {dir:?}, {t2:?})")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue