about summary refs log tree commit diff
path: root/src/librustc_mir
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2020-01-24 16:22:24 +0000
committervarkor <github@varkor.com>2020-01-24 16:23:32 +0000
commit50dd8eaeb9ebbccb8b79ff30d3068d0ee337cd2f (patch)
treeb0f9a40f3f36b1e0056386f68f3342720e6b6f36 /src/librustc_mir
parentdee12bb2b7d75cce8fc8f21b5d7ea0da920df5e5 (diff)
downloadrust-50dd8eaeb9ebbccb8b79ff30d3068d0ee337cd2f.tar.gz
rust-50dd8eaeb9ebbccb8b79ff30d3068d0ee337cd2f.zip
Print constants in `type_name` for const generics
Diffstat (limited to 'src/librustc_mir')
-rw-r--r--src/librustc_mir/interpret/intrinsics/type_name.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/librustc_mir/interpret/intrinsics/type_name.rs b/src/librustc_mir/interpret/intrinsics/type_name.rs
index eed47c147c6..cd8bf7085d1 100644
--- a/src/librustc_mir/interpret/intrinsics/type_name.rs
+++ b/src/librustc_mir/interpret/intrinsics/type_name.rs
@@ -69,9 +69,8 @@ impl<'tcx> Printer<'tcx> for AbsolutePathPrinter<'tcx> {
         }
     }
 
-    fn print_const(self, _: &'tcx ty::Const<'tcx>) -> Result<Self::Const, Self::Error> {
-        // don't print constants to the user
-        Ok(self)
+    fn print_const(self, ct: &'tcx ty::Const<'tcx>) -> Result<Self::Const, Self::Error> {
+        self.pretty_print_const(ct, false)
     }
 
     fn print_dyn_existential(