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 {
|
|
|
|
match *self {
|
2020-09-24 19:22:36 +02:00
|
|
|
super::ImplSource::UserDefined(ref v) => write!(f, "{:?}", v),
|
2020-01-22 13:42:04 +01:00
|
|
|
|
2023-06-16 02:10:10 +00:00
|
|
|
super::ImplSource::Builtin(ref d) => write!(f, "{:?}", d),
|
2020-01-22 13:42:04 +01:00
|
|
|
|
2020-09-24 19:22:36 +02:00
|
|
|
super::ImplSource::Object(ref d) => write!(f, "{:?}", d),
|
2020-01-22 13:42:04 +01:00
|
|
|
|
2020-11-22 02:13:53 +01:00
|
|
|
super::ImplSource::Param(ref n, ct) => {
|
|
|
|
write!(f, "ImplSourceParamData({:?}, {:?})", n, ct)
|
|
|
|
}
|
2020-01-22 13:42:04 +01:00
|
|
|
|
2023-07-16 22:42:46 +00:00
|
|
|
super::ImplSource::TupleUnsizing(ref d) => write!(f, "{:?}", d),
|
|
|
|
|
2021-08-18 12:45:18 +08:00
|
|
|
super::ImplSource::TraitUpcasting(ref d) => write!(f, "{:?}", d),
|
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
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-16 00:23:20 +00:00
|
|
|
impl<N: fmt::Debug> fmt::Debug for traits::ImplSourceTraitUpcastingData<N> {
|
2021-08-18 12:45:18 +08:00
|
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
|
|
write!(
|
|
|
|
f,
|
2023-06-16 00:23:20 +00:00
|
|
|
"ImplSourceTraitUpcastingData(vtable_vptr_slot={:?}, nested={:?})",
|
|
|
|
self.vtable_vptr_slot, self.nested
|
2021-08-18 12:45:18 +08:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-16 00:48:29 +00:00
|
|
|
impl<N: fmt::Debug> fmt::Debug for traits::ImplSourceObjectData<N> {
|
2020-01-22 13:42:04 +01:00
|
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
|
|
write!(
|
|
|
|
f,
|
2023-06-20 21:48:05 +00:00
|
|
|
"ImplSourceObjectData(vtable_base={}, nested={:?})",
|
|
|
|
self.vtable_base, self.nested
|
2020-01-22 13:42:04 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|