impl<'tcx, T> fmt::Display for Highlighted<'tcx, T>
where
- T: for<'a, 'b, 'c> Print<
+ T: for<'a> Print<
'tcx,
- FmtPrinter<'a, 'tcx, &'b mut fmt::Formatter<'c>>,
+ FmtPrinter<'a, 'tcx>,
Error = fmt::Error,
+ Output = FmtPrinter<'a, 'tcx>,
>,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- let mut printer = ty::print::FmtPrinter::new(self.tcx, f, Namespace::TypeNS);
+ let mut printer = ty::print::FmtPrinter::new(self.tcx, Namespace::TypeNS);
printer.region_highlight_mode = self.highlight;
- self.value.print(printer)?;
- Ok(())
+ let s = self.value.print(printer)?.into_buffer();
+ f.write_str(&s)
}
}