2020-01-22 13:42:04 +01:00
|
|
|
use crate::traits;
|
|
|
|
|
|
|
|
use std::fmt;
|
|
|
|
|
|
|
|
// Structural impls for the structs in `traits`.
|
|
|
|
|
2020-05-11 15:25:33 +00:00
|
|
|
impl<'tcx, N: fmt::Debug> fmt::Debug for traits::ImplSource<'tcx, N> {
|
2020-01-22 13:42:04 +01:00
|
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
2023-07-24 22:02:52 +00:00
|
|
|
match self {
|
2023-07-25 22:00:13 +02:00
|
|
|
super::ImplSource::UserDefined(v) => write!(f, "{v:?}"),
|
2020-01-22 13:42:04 +01:00
|
|
|
|
2023-07-24 22:02:52 +00:00
|
|
|
super::ImplSource::Builtin(source, d) => {
|
|
|
|
write!(f, "Builtin({source:?}, {d:?})")
|
|
|
|
}
|
2020-01-22 13:42:04 +01:00
|
|
|
|
2023-07-24 22:02:52 +00:00
|
|
|
super::ImplSource::Param(ct, n) => {
|
2023-07-25 22:00:13 +02:00
|
|
|
write!(f, "ImplSourceParamData({n:?}, {ct:?})")
|
2020-11-22 02:13:53 +01:00
|
|
|
}
|
2020-01-22 13:42:04 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-02 15:54:24 +00:00
|
|
|
impl<'tcx, N: fmt::Debug> fmt::Debug for traits::ImplSourceUserDefinedData<'tcx, N> {
|
2020-01-22 13:42:04 +01:00
|
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
|
|
write!(
|
|
|
|
f,
|
2023-07-11 22:35:29 +01:00
|
|
|
"ImplSourceUserDefinedData(impl_def_id={:?}, args={:?}, nested={:?})",
|
|
|
|
self.impl_def_id, self.args, self.nested
|
2020-01-22 13:42:04 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|