@@ -4,9 +4,10 @@ use measureme::{StringComponent, StringId};
4
4
use rustc_data_structures:: fx:: FxHashMap ;
5
5
use rustc_data_structures:: profiling:: SelfProfiler ;
6
6
use rustc_hir:: def_id:: { CrateNum , DefId , DefIndex , LocalDefId , CRATE_DEF_INDEX , LOCAL_CRATE } ;
7
- use rustc_hir:: definitions:: { DefPathData , DefPathDataName } ;
7
+ use rustc_hir:: definitions:: DefPathData ;
8
8
use rustc_query_system:: query:: QueryCache ;
9
9
use rustc_query_system:: query:: QueryState ;
10
+ use rustc_span:: symbol:: Symbol ;
10
11
use std:: fmt:: Debug ;
11
12
use std:: io:: Write ;
12
13
@@ -66,25 +67,17 @@ impl<'p, 'c, 'tcx> QueryKeyStringBuilder<'p, 'c, 'tcx> {
66
67
end_index = 3 ;
67
68
}
68
69
other => {
69
- name = match other. name ( ) {
70
- DefPathDataName :: Named ( name) => {
71
- dis = "" ;
72
- end_index = 3 ;
73
- name
74
- }
75
- DefPathDataName :: Anon { namespace } => {
76
- write ! (
77
- & mut dis_buffer[ ..] ,
78
- "[{}]" ,
79
- def_key. disambiguated_data. disambiguator
80
- )
70
+ name = Symbol :: intern ( & other. to_string ( ) ) ;
71
+ if def_key. disambiguated_data . disambiguator == 0 {
72
+ dis = "" ;
73
+ end_index = 3 ;
74
+ } else {
75
+ write ! ( & mut dis_buffer[ ..] , "[{}]" , def_key. disambiguated_data. disambiguator)
81
76
. unwrap ( ) ;
82
- let end_of_dis = dis_buffer. iter ( ) . position ( |& c| c == b']' ) . unwrap ( ) ;
83
- dis = std:: str:: from_utf8 ( & dis_buffer[ ..end_of_dis + 1 ] ) . unwrap ( ) ;
84
- end_index = 4 ;
85
- namespace
86
- }
87
- } ;
77
+ let end_of_dis = dis_buffer. iter ( ) . position ( |& c| c == b']' ) . unwrap ( ) ;
78
+ dis = std:: str:: from_utf8 ( & dis_buffer[ ..end_of_dis + 1 ] ) . unwrap ( ) ;
79
+ end_index = 4 ;
80
+ }
88
81
}
89
82
}
90
83
0 commit comments