@@ -323,28 +323,26 @@ impl<'tcx> TypeMap<'tcx> {
323
323
fn get_unique_type_id_of_type < ' a > ( & mut self , cx : & CrateContext < ' a , ' tcx > ,
324
324
type_ : Ty < ' tcx > ) -> UniqueTypeId {
325
325
326
- // basic type -> {:name of the type:}
327
- // tuple -> {tuple_(:param-uid:)*}
328
- // struct -> {struct_:svh: / :node-id:_<(:param-uid:),*> }
329
- // enum -> {enum_:svh: / :node-id:_<(:param-uid:),*> }
330
- // enum variant -> {variant_:variant-name:_:enum-uid:}
331
- // reference (&) -> {& :pointee-uid:}
332
- // mut reference (&mut) -> {&mut :pointee-uid:}
333
- // ptr (*) -> {* :pointee-uid:}
334
- // mut ptr (*mut) -> {*mut :pointee-uid:}
335
- // unique ptr (~) -> {~ :pointee-uid:}
336
- // @-ptr (@) -> {@ :pointee-uid:}
337
- // sized vec ([T; x]) -> {[:size:] :element-uid:}
338
- // unsized vec ([T]) -> {[] :element-uid:}
339
- // trait (T) -> {trait_:svh: / :node-id:_<(:param-uid:),*> }
340
- // closure -> {<unsafe_> <once_> :store-sigil:
341
- // |(:param-uid:),* <,_...>| -> \
342
- // :return-type-uid: : (:bounds:)*}
343
- // function -> {<unsafe_> <abi_> fn( (:param-uid:)* <,_...> ) -> \
344
- // :return-type-uid:}
345
- // unique vec box (~[]) -> {HEAP_VEC_BOX<:pointee-uid:>}
346
- // gc box -> {GC_BOX<:pointee-uid:>}
347
- // projection (<T as U>::V) -> {<:ty-uid: as :trait-uid:> :: :name-uid: }
326
+ // basic type -> {:name of the type:}
327
+ // tuple -> {tuple_(:param-uid:)*}
328
+ // struct -> {struct_:svh: / :node-id:_<(:param-uid:),*> }
329
+ // enum -> {enum_:svh: / :node-id:_<(:param-uid:),*> }
330
+ // enum variant -> {variant_:variant-name:_:enum-uid:}
331
+ // reference (&) -> {& :pointee-uid:}
332
+ // mut reference (&mut) -> {&mut :pointee-uid:}
333
+ // ptr (*) -> {* :pointee-uid:}
334
+ // mut ptr (*mut) -> {*mut :pointee-uid:}
335
+ // unique ptr (~) -> {~ :pointee-uid:}
336
+ // @-ptr (@) -> {@ :pointee-uid:}
337
+ // sized vec ([T; x]) -> {[:size:] :element-uid:}
338
+ // unsized vec ([T]) -> {[] :element-uid:}
339
+ // trait (T) -> {trait_:svh: / :node-id:_<(:param-uid:),*> }
340
+ // closure -> {<unsafe_> <once_> :store-sigil: |(:param-uid:),* <,_...>| -> \
341
+ // :return-type-uid: : (:bounds:)*}
342
+ // function -> {<unsafe_> <abi_> fn( (:param-uid:)* <,_...> ) -> \
343
+ // :return-type-uid:}
344
+ // unique vec box (~[]) -> {HEAP_VEC_BOX<:pointee-uid:>}
345
+ // gc box -> {GC_BOX<:pointee-uid:>}
348
346
349
347
match self . type_to_unique_id . get ( & type_) . cloned ( ) {
350
348
Some ( unique_type_id) => return unique_type_id,
@@ -437,25 +435,6 @@ impl<'tcx> TypeMap<'tcx> {
437
435
principal. substs ,
438
436
& mut unique_type_id) ;
439
437
} ,
440
- ty:: ty_projection( ref projection) => {
441
- unique_type_id. push_str ( "<" ) ;
442
-
443
- let self_ty = projection. trait_ref . self_ty ( ) ;
444
- let self_type_id = self . get_unique_type_id_of_type ( cx, self_ty) ;
445
- let self_type_id = self . get_unique_type_id_as_string ( self_type_id) ;
446
- unique_type_id. push_str ( & self_type_id[ ] ) ;
447
-
448
- unique_type_id. push_str ( " as " ) ;
449
-
450
- from_def_id_and_substs ( self ,
451
- cx,
452
- projection. trait_ref . def_id ,
453
- projection. trait_ref . substs ,
454
- & mut unique_type_id) ;
455
-
456
- unique_type_id. push_str ( ">::" ) ;
457
- unique_type_id. push_str ( token:: get_name ( projection. item_name ) . get ( ) ) ;
458
- } ,
459
438
ty:: ty_bare_fn( _, & ty:: BareFnTy { unsafety, abi, ref sig } ) => {
460
439
if unsafety == ast:: Unsafety :: Unsafe {
461
440
unique_type_id. push_str ( "unsafe " ) ;
@@ -499,10 +478,7 @@ impl<'tcx> TypeMap<'tcx> {
499
478
closure_ty,
500
479
& mut unique_type_id) ;
501
480
} ,
502
- ty:: ty_err |
503
- ty:: ty_infer( _) |
504
- ty:: ty_open( _) |
505
- ty:: ty_param( _) => {
481
+ _ => {
506
482
cx. sess ( ) . bug ( & format ! ( "get_unique_type_id_of_type() - unexpected type: {}, {:?}" ,
507
483
& ppaux:: ty_to_string( cx. tcx( ) , type_) [ ] ,
508
484
type_. sty) [ ] )
@@ -3879,22 +3855,10 @@ fn push_debuginfo_type_name<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
3879
3855
ty:: ty_unboxed_closure( ..) => {
3880
3856
output. push_str ( "closure" ) ;
3881
3857
}
3882
- ty:: ty_projection( ref projection) => {
3883
- output. push_str ( "<" ) ;
3884
- let self_ty = projection. trait_ref . self_ty ( ) ;
3885
- push_debuginfo_type_name ( cx, self_ty, true , output) ;
3886
-
3887
- output. push_str ( " as " ) ;
3888
-
3889
- push_item_name ( cx, projection. trait_ref . def_id , false , output) ;
3890
- push_type_params ( cx, projection. trait_ref . substs , output) ;
3891
-
3892
- output. push_str ( ">::" ) ;
3893
- output. push_str ( token:: get_name ( projection. item_name ) . get ( ) ) ;
3894
- }
3895
3858
ty:: ty_err |
3896
3859
ty:: ty_infer( _) |
3897
3860
ty:: ty_open( _) |
3861
+ ty:: ty_projection( ..) |
3898
3862
ty:: ty_param( _) => {
3899
3863
cx. sess ( ) . bug ( & format ! ( "debuginfo: Trying to create type name for \
3900
3864
unexpected type: {}", ppaux:: ty_to_string( cx. tcx( ) , t) ) [ ] ) ;
0 commit comments