@@ -3,7 +3,7 @@ use self::collector::NodeCollector;
33use crate :: hir:: { Owner , OwnerNodes } ;
44use crate :: ty:: query:: Providers ;
55use crate :: ty:: TyCtxt ;
6- use rustc_ast:: ast:: { self , NodeId } ;
6+ use rustc_ast:: ast:: { self } ;
77use rustc_data_structures:: svh:: Svh ;
88use rustc_hir:: def:: { DefKind , Res } ;
99use rustc_hir:: def_id:: { CrateNum , DefId , LocalDefId , CRATE_DEF_INDEX , LOCAL_CRATE } ;
@@ -157,18 +157,6 @@ impl<'hir> Map<'hir> {
157157 self . tcx . definitions . def_path ( def_id)
158158 }
159159
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-
172160 #[ inline]
173161 pub fn local_def_id ( & self , hir_id : HirId ) -> LocalDefId {
174162 self . opt_local_def_id ( hir_id) . unwrap_or_else ( || {
@@ -182,35 +170,14 @@ impl<'hir> Map<'hir> {
182170
183171 #[ inline]
184172 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)
192174 }
193175
194176 #[ inline]
195177 pub fn as_local_hir_id ( & self , def_id : LocalDefId ) -> HirId {
196178 self . tcx . definitions . as_local_hir_id ( def_id)
197179 }
198180
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-
214181 #[ inline]
215182 pub fn local_def_id_to_hir_id ( & self , def_id : LocalDefId ) -> HirId {
216183 self . tcx . definitions . local_def_id_to_hir_id ( def_id)
0 commit comments