@@ -39,7 +39,6 @@ use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res};
39
39
use rustc_hir:: def_id:: { CrateNum , DefId , LocalDefId , LocalDefIdMap , CRATE_DEF_INDEX } ;
40
40
use rustc_hir:: { Constness , Node } ;
41
41
use rustc_macros:: HashStable ;
42
- use rustc_span:: hygiene:: ExpnId ;
43
42
use rustc_span:: symbol:: { kw, Ident , Symbol } ;
44
43
use rustc_span:: Span ;
45
44
use rustc_target:: abi:: Align ;
@@ -1862,20 +1861,11 @@ impl<'tcx> TyCtxt<'tcx> {
1862
1861
&& use_name
1863
1862
. span
1864
1863
. 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) )
1875
1865
}
1876
1866
1877
1867
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) ) ;
1879
1869
ident
1880
1870
}
1881
1871
@@ -1886,8 +1876,7 @@ impl<'tcx> TyCtxt<'tcx> {
1886
1876
block : hir:: HirId ,
1887
1877
) -> ( Ident , DefId ) {
1888
1878
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) ) {
1891
1880
Some ( actual_expansion) => {
1892
1881
self . hir ( ) . definitions ( ) . parent_module_of_macro_def ( actual_expansion)
1893
1882
}
0 commit comments