| 1813 | } |
| 1814 | |
| 1815 | fn display(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 1816 | match self.unpack() { |
| 1817 | OomOrDynErrorRef::DynError(e) => { |
| 1818 | // Safety: invariant of this type. |
| 1819 | let vtable = unsafe { e.as_ref().vtable }; |
| 1820 | // Safety: using the vtable associated with this pointer's |
| 1821 | // concrete type and the pointer is valid. |
| 1822 | unsafe { (vtable.display)(e, f) } |
| 1823 | } |
| 1824 | OomOrDynErrorRef::Oom(oom) => fmt::Display::fmt(oom, f), |
| 1825 | } |
| 1826 | } |
| 1827 | |
| 1828 | fn debug(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 1829 | match self.unpack() { |