diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs
index eba3016aca8..df37b2b4628 100644
--- a/compiler/rustc_middle/src/ty/print/pretty.rs
+++ b/compiler/rustc_middle/src/ty/print/pretty.rs
@@ -1295,10 +1295,10 @@ pub trait PrettyPrinter<'tcx>:
                             if let Ok(snip) = self.tcx().sess.source_map().span_to_snippet(span) {
                                 p!(write("{}", snip))
                             } else {
-                                print_underscore!()
+                                p!(print_value_path(def.did, substs))
                             }
                         } else {
-                            print_underscore!()
+                            p!(print_value_path(def.did, substs))
                         }
                     }
                     defkind => bug!("`{:?}` has unexpcted defkind {:?}", ct, defkind),
@@ -1323,7 +1323,7 @@ pub trait PrettyPrinter<'tcx>:
             ty::ConstKind::Placeholder(placeholder) => p!(write("Placeholder({:?})", placeholder)),
             // FIXME(generic_const_exprs):
             // write out some legible representation of an abstract const?
-            ty::ConstKind::Expr(_) => p!("[Const Expr]"),
+            ty::ConstKind::Expr(_) => p!("[const expr]"),
             ty::ConstKind::Error(_) => p!("[const error]"),
         };
         Ok(self)
diff --git a/tests/ui/const-generics/generic_const_exprs/non_local_anon_const_diagnostics.stderr b/tests/ui/const-generics/generic_const_exprs/non_local_anon_const_diagnostics.stderr
index c18281beb05..c1a846acf88 100644
--- a/tests/ui/const-generics/generic_const_exprs/non_local_anon_const_diagnostics.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/non_local_anon_const_diagnostics.stderr
@@ -2,10 +2,10 @@ error[E0308]: mismatched types
   --> $DIR/non_local_anon_const_diagnostics.rs:12:43
    |
 LL |     let _: anon_const_non_local::Foo<2> = anon_const_non_local::foo::<M>();
-   |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2`, found `_`
+   |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2`, found `foo::<M>::{constant#0}`
    |
    = note: expected constant `2`
-              found constant `_`
+              found constant `foo::<M>::{constant#0}`
 
 error: aborting due to previous error