From e90674574d21f8245716c0644b0c8aa2e1702b54 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 20 Feb 2021 11:34:35 +0100 Subject: [PATCH] fn ptr pretty printing: fall back to raw ptr printing --- compiler/rustc_middle/src/ty/print/pretty.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index f934e31a534d2..cc41fd855e83b 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -1018,7 +1018,7 @@ pub trait PrettyPrinter<'tcx>: p!(write("{:?}", char::try_from(int).unwrap())) } // Raw pointers - (Scalar::Int(int), ty::RawPtr(_)) => { + (Scalar::Int(int), ty::RawPtr(_) | ty::FnPtr(_)) => { let data = int.assert_bits(self.tcx().data_layout.pointer_size); self = self.typed_value( |mut this| { @@ -1040,8 +1040,7 @@ pub trait PrettyPrinter<'tcx>: " as ", )?; } - Some(_) => p!(""), - None => p!(""), + _ => self = self.pretty_print_const_pointer(ptr, ty, print_ty)?, } } // For function type zsts just printing the path is enough