Skip to content

Commit a2a50f9

Browse files
committed
actually print out non local anon consts
1 parent 88f81a0 commit a2a50f9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

compiler/rustc_middle/src/ty/print/pretty.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1295,10 +1295,10 @@ pub trait PrettyPrinter<'tcx>:
12951295
if let Ok(snip) = self.tcx().sess.source_map().span_to_snippet(span) {
12961296
p!(write("{}", snip))
12971297
} else {
1298-
print_underscore!()
1298+
p!(print_value_path(def.did, substs))
12991299
}
13001300
} else {
1301-
print_underscore!()
1301+
p!(print_value_path(def.did, substs))
13021302
}
13031303
}
13041304
defkind => bug!("`{:?}` has unexpcted defkind {:?}", ct, defkind),
@@ -1323,7 +1323,7 @@ pub trait PrettyPrinter<'tcx>:
13231323
ty::ConstKind::Placeholder(placeholder) => p!(write("Placeholder({:?})", placeholder)),
13241324
// FIXME(generic_const_exprs):
13251325
// write out some legible representation of an abstract const?
1326-
ty::ConstKind::Expr(_) => p!("[Const Expr]"),
1326+
ty::ConstKind::Expr(_) => p!("[const expr]"),
13271327
ty::ConstKind::Error(_) => p!("[const error]"),
13281328
};
13291329
Ok(self)

tests/ui/const-generics/generic_const_exprs/non_local_anon_const_diagnostics.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ error[E0308]: mismatched types
22
--> $DIR/non_local_anon_const_diagnostics.rs:12:43
33
|
44
LL | let _: anon_const_non_local::Foo<2> = anon_const_non_local::foo::<M>();
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2`, found `_`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2`, found `foo::<M>::{constant#0}`
66
|
77
= note: expected constant `2`
8-
found constant `_`
8+
found constant `foo::<M>::{constant#0}`
99

1010
error: aborting due to previous error
1111

0 commit comments

Comments
 (0)