summary refs log tree commit diff
path: root/src/librustc_codegen_utils
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2019-01-14 17:55:57 +0200
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2019-03-15 13:25:10 +0200
commit88d96b269c77a0de2c143c797aeb61e928f32e03 (patch)
treec35c91c16c64af4f037a2e7b85eecb66afcb9028 /src/librustc_codegen_utils
parentfc914aa88a525eb6d78d0331fc59fa2d0a60b3b6 (diff)
downloadrust-88d96b269c77a0de2c143c797aeb61e928f32e03.tar.gz
rust-88d96b269c77a0de2c143c797aeb61e928f32e03.zip
rustc: support overriding region printing in ty::print::Printer.
Diffstat (limited to 'src/librustc_codegen_utils')
-rw-r--r--src/librustc_codegen_utils/symbol_names.rs17
1 files changed, 16 insertions, 1 deletions
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<Self::Region, Self::Error> {
+        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 {