@@ -3,7 +3,7 @@ use self::collector::NodeCollector;
3
3
use crate :: hir:: { Owner , OwnerNodes } ;
4
4
use crate :: ty:: query:: Providers ;
5
5
use crate :: ty:: TyCtxt ;
6
- use rustc_ast:: ast:: { self , NodeId } ;
6
+ use rustc_ast:: ast:: { self } ;
7
7
use rustc_data_structures:: svh:: Svh ;
8
8
use rustc_hir:: def:: { DefKind , Res } ;
9
9
use rustc_hir:: def_id:: { CrateNum , DefId , LocalDefId , CRATE_DEF_INDEX , LOCAL_CRATE } ;
@@ -157,18 +157,6 @@ impl<'hir> Map<'hir> {
157
157
self . tcx . definitions . def_path ( def_id)
158
158
}
159
159
160
- #[ inline]
161
- pub fn local_def_id_from_node_id ( & self , node : NodeId ) -> LocalDefId {
162
- self . opt_local_def_id_from_node_id ( node) . unwrap_or_else ( || {
163
- let hir_id = self . node_id_to_hir_id ( node) ;
164
- bug ! (
165
- "local_def_id_from_node_id: no entry for `{}`, which has a map of `{:?}`" ,
166
- node,
167
- self . find_entry( hir_id)
168
- )
169
- } )
170
- }
171
-
172
160
#[ inline]
173
161
pub fn local_def_id ( & self , hir_id : HirId ) -> LocalDefId {
174
162
self . opt_local_def_id ( hir_id) . unwrap_or_else ( || {
@@ -182,35 +170,14 @@ impl<'hir> Map<'hir> {
182
170
183
171
#[ inline]
184
172
pub fn opt_local_def_id ( & self , hir_id : HirId ) -> Option < LocalDefId > {
185
- let node_id = self . hir_id_to_node_id ( hir_id) ;
186
- self . opt_local_def_id_from_node_id ( node_id)
187
- }
188
-
189
- #[ inline]
190
- pub fn opt_local_def_id_from_node_id ( & self , node : NodeId ) -> Option < LocalDefId > {
191
- self . tcx . definitions . opt_local_def_id ( node)
173
+ self . tcx . definitions . opt_hir_id_to_local_def_id ( hir_id)
192
174
}
193
175
194
176
#[ inline]
195
177
pub fn as_local_hir_id ( & self , def_id : LocalDefId ) -> HirId {
196
178
self . tcx . definitions . as_local_hir_id ( def_id)
197
179
}
198
180
199
- #[ inline]
200
- pub fn hir_id_to_node_id ( & self , hir_id : HirId ) -> NodeId {
201
- self . tcx . definitions . hir_id_to_node_id ( hir_id)
202
- }
203
-
204
- #[ inline]
205
- pub fn node_id_to_hir_id ( & self , node_id : NodeId ) -> HirId {
206
- self . tcx . definitions . node_id_to_hir_id ( node_id)
207
- }
208
-
209
- #[ inline]
210
- pub fn opt_node_id_to_hir_id ( & self , node_id : NodeId ) -> Option < HirId > {
211
- self . tcx . definitions . opt_node_id_to_hir_id ( node_id)
212
- }
213
-
214
181
#[ inline]
215
182
pub fn local_def_id_to_hir_id ( & self , def_id : LocalDefId ) -> HirId {
216
183
self . tcx . definitions . local_def_id_to_hir_id ( def_id)
0 commit comments