Always format to internal String in FmtPrinter

This avoids monomorphizing for different parameters, decreasing generic code
instantiated downstream from rustc_middle.
This commit is contained in:
Mark Rousskov
2022-02-18 16:15:29 -05:00
parent 45e2c2881d
commit efb99d780d
10 changed files with 82 additions and 80 deletions

View File

@@ -983,10 +983,9 @@ fn foo(&self) -> Self::T { String::new() }
}
fn format_generic_args(self, args: &[ty::GenericArg<'tcx>]) -> String {
let mut item_args = String::new();
FmtPrinter::new(self, &mut item_args, hir::def::Namespace::TypeNS)
FmtPrinter::new(self, hir::def::Namespace::TypeNS)
.path_generic_args(Ok, args)
.expect("could not write to `String`.");
item_args
.expect("could not write to `String`.")
.into_buffer()
}
}