@@ -251,25 +251,17 @@ impl PrintContext {
251251 fn parameterized < F : fmt:: Write > ( & mut self ,
252252 f : & mut F ,
253253 substs : & subst:: Substs < ' _ > ,
254- mut did : DefId ,
254+ did : DefId ,
255255 projections : & [ ty:: ProjectionPredicate < ' _ > ] )
256256 -> fmt:: Result {
257257 let key = ty:: tls:: with ( |tcx| tcx. def_key ( did) ) ;
258- let mut item_name = if let Some ( name) = key. disambiguated_data . data . get_opt_name ( ) {
259- Some ( name)
260- } else {
261- did. index = key. parent . unwrap_or_else (
262- || bug ! ( "finding type for {:?}, encountered def-id {:?} with no parent" ,
263- did, did) ) ;
264- self . parameterized ( f, substs, did, projections) ?;
265- return write ! ( f, "::{}" , key. disambiguated_data. data. as_interned_str( ) ) ;
266- } ;
267258
268259 let verbose = self . is_verbose ;
269260 let mut num_supplied_defaults = 0 ;
270261 let mut has_self = false ;
271262 let mut own_counts: GenericParamCount = Default :: default ( ) ;
272263 let mut is_value_path = false ;
264+ let mut item_name = Some ( key. disambiguated_data . data . as_interned_str ( ) ) ;
273265 let fn_trait_kind = ty:: tls:: with ( |tcx| {
274266 // Unfortunately, some kinds of items (e.g., closures) don't have
275267 // generics. So walk back up the find the closest parent that DOES
@@ -282,6 +274,7 @@ impl PrintContext {
282274 DefPathData :: AssocTypeInImpl ( _) |
283275 DefPathData :: AssocExistentialInImpl ( _) |
284276 DefPathData :: Trait ( _) |
277+ DefPathData :: Impl |
285278 DefPathData :: TypeNs ( _) => {
286279 break ;
287280 }
@@ -292,7 +285,6 @@ impl PrintContext {
292285 }
293286 DefPathData :: CrateRoot |
294287 DefPathData :: Misc |
295- DefPathData :: Impl |
296288 DefPathData :: Module ( _) |
297289 DefPathData :: MacroDef ( _) |
298290 DefPathData :: ClosureExpr |
0 commit comments