@@ -39,7 +39,6 @@ use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res};
3939use rustc_hir:: def_id:: { CrateNum , DefId , LocalDefId , LocalDefIdMap , CRATE_DEF_INDEX } ;
4040use rustc_hir:: { Constness , Node } ;
4141use rustc_macros:: HashStable ;
42- use rustc_span:: hygiene:: ExpnId ;
4342use rustc_span:: symbol:: { kw, Ident , Symbol } ;
4443use rustc_span:: Span ;
4544use rustc_target:: abi:: Align ;
@@ -1862,20 +1861,11 @@ impl<'tcx> TyCtxt<'tcx> {
18621861 && use_name
18631862 . span
18641863 . ctxt ( )
1865- . hygienic_eq ( def_name. span . ctxt ( ) , self . expansion_that_defined ( def_parent_def_id) )
1866- }
1867-
1868- pub fn expansion_that_defined ( self , scope : DefId ) -> ExpnId {
1869- match scope. as_local ( ) {
1870- // Parsing and expansion aren't incremental, so we don't
1871- // need to go through a query for the same-crate case.
1872- Some ( scope) => self . hir ( ) . definitions ( ) . expansion_that_defined ( scope) ,
1873- None => self . expn_that_defined ( scope) ,
1874- }
1864+ . hygienic_eq ( def_name. span . ctxt ( ) , self . expn_that_defined ( def_parent_def_id) )
18751865 }
18761866
18771867 pub fn adjust_ident ( self , mut ident : Ident , scope : DefId ) -> Ident {
1878- ident. span . normalize_to_macros_2_0_and_adjust ( self . expansion_that_defined ( scope) ) ;
1868+ ident. span . normalize_to_macros_2_0_and_adjust ( self . expn_that_defined ( scope) ) ;
18791869 ident
18801870 }
18811871
@@ -1886,8 +1876,7 @@ impl<'tcx> TyCtxt<'tcx> {
18861876 block : hir:: HirId ,
18871877 ) -> ( Ident , DefId ) {
18881878 let scope =
1889- match ident. span . normalize_to_macros_2_0_and_adjust ( self . expansion_that_defined ( scope) )
1890- {
1879+ match ident. span . normalize_to_macros_2_0_and_adjust ( self . expn_that_defined ( scope) ) {
18911880 Some ( actual_expansion) => {
18921881 self . hir ( ) . definitions ( ) . parent_module_of_macro_def ( actual_expansion)
18931882 }
0 commit comments