about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBoxy <supbscripter@gmail.com>2023-01-14 19:03:50 +0000
committerBoxy <supbscripter@gmail.com>2023-01-18 04:07:39 +0000
commita2a50f96f3532347a0ad61f2d6bfed4c64de4e54 (patch)
tree96b6c8995ab936d843d546bdce91f466519f1d8a
parent88f81a0de122843afc122468823f1ed6f0b8f2c8 (diff)
downloadrust-a2a50f96f3532347a0ad61f2d6bfed4c64de4e54.tar.gz
rust-a2a50f96f3532347a0ad61f2d6bfed4c64de4e54.zip
actually print out non local anon consts
-rw-r--r--compiler/rustc_middle/src/ty/print/pretty.rs6
-rw-r--r--tests/ui/const-generics/generic_const_exprs/non_local_anon_const_diagnostics.stderr4
2 files changed, 5 insertions, 5 deletions
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