1
Fork 0

Remove Print::Error

All printing goes through `fmt::Error` now.
This commit is contained in:
Nilstrieb 2023-10-16 20:50:46 +02:00
parent 6038888118
commit 6fc6a6d783
6 changed files with 17 additions and 32 deletions

View file

@ -28,7 +28,7 @@ pub struct Highlighted<'tcx, T> {
impl<'tcx, T> IntoDiagnosticArg for Highlighted<'tcx, T>
where
T: for<'a> Print<'tcx, FmtPrinter<'a, 'tcx>, Error = fmt::Error>,
T: for<'a> Print<'tcx, FmtPrinter<'a, 'tcx>>,
{
fn into_diagnostic_arg(self) -> rustc_errors::DiagnosticArgValue<'static> {
rustc_errors::DiagnosticArgValue::Str(self.to_string().into())
@ -43,7 +43,7 @@ impl<'tcx, T> Highlighted<'tcx, T> {
impl<'tcx, T> fmt::Display for Highlighted<'tcx, T>
where
T: for<'a> Print<'tcx, FmtPrinter<'a, 'tcx>, Error = fmt::Error>,
T: for<'a> Print<'tcx, FmtPrinter<'a, 'tcx>>,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut printer = ty::print::FmtPrinter::new(self.tcx, Namespace::TypeNS);