From 88d96b269c77a0de2c143c797aeb61e928f32e03 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Mon, 14 Jan 2019 17:55:57 +0200 Subject: rustc: support overriding region printing in ty::print::Printer. --- src/librustc_codegen_utils/symbol_names.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/librustc_codegen_utils') diff --git a/src/librustc_codegen_utils/symbol_names.rs b/src/librustc_codegen_utils/symbol_names.rs index 2f962733118..912f8149513 100644 --- a/src/librustc_codegen_utils/symbol_names.rs +++ b/src/librustc_codegen_utils/symbol_names.rs @@ -409,6 +409,14 @@ impl Printer for SymbolPath { type Error = fmt::Error; type Path = Self; + type Region = Self; + + fn print_region( + self: PrintCx<'_, '_, '_, Self>, + _region: ty::Region<'_>, + ) -> Result { + Ok(self.printer) + } fn path_crate( mut self: PrintCx<'_, '_, '_, Self>, @@ -511,7 +519,14 @@ impl Printer for SymbolPath { } } -impl PrettyPrinter for SymbolPath {} +impl PrettyPrinter for SymbolPath { + fn print_region_outputs_anything( + self: &PrintCx<'_, '_, '_, Self>, + _region: ty::Region<'_>, + ) -> bool { + false + } +} impl fmt::Write for SymbolPath { fn write_str(&mut self, s: &str) -> fmt::Result { -- cgit 1.4.1-3-g733a5