@@ -165,19 +165,12 @@ impl DefPathBasedNames<'tcx> {
165
165
}
166
166
167
167
// Pushes the the name of the specified const to the provided string.
168
- // If `debug` is true, usually-unprintable consts (such as `Infer`) will be printed,
169
- // as well as the unprintable types of constants (see `push_type_name` for more details).
170
- pub fn push_const_name ( & self , c : & Const < ' tcx > , output : & mut String , debug : bool ) {
171
- if let ty:: ConstKind :: Value ( _) = c. val {
172
- // FIXME(const_generics): we could probably do a better job here.
173
- write ! ( output, "{:?}" , c) . unwrap ( )
174
- } else if debug {
175
- write ! ( output, "{:?}" , c) . unwrap ( )
176
- } else {
177
- bug ! ( "DefPathBasedNames: trying to create const name for unexpected const: {:?}" , c, ) ;
178
- }
168
+ // If `debug` is true, the unprintable types of constants will be printed with `fmt::Debug`
169
+ // (see `push_type_name` for more details).
170
+ pub fn push_const_name ( & self , ct : & Const < ' tcx > , output : & mut String , debug : bool ) {
171
+ write ! ( output, "{}" , ct) . unwrap ( ) ;
179
172
output. push_str ( ": " ) ;
180
- self . push_type_name ( c . ty , output, debug) ;
173
+ self . push_type_name ( ct . ty , output, debug) ;
181
174
}
182
175
183
176
pub fn push_def_path ( & self , def_id : DefId , output : & mut String ) {
0 commit comments