@@ -82,9 +82,6 @@ pub trait Resolver {
82
82
// Obtain the resolution for a node id
83
83
fn get_resolution ( & mut self , id : NodeId ) -> Option < PathResolution > ;
84
84
85
- // Record the resolution of a path or binding generated by the lowerer when expanding.
86
- fn record_resolution ( & mut self , id : NodeId , def : Def ) ;
87
-
88
85
// We must keep the set of definitions up to date as we add nodes that weren't in the AST.
89
86
// This should only return `None` during testing.
90
87
fn definitions ( & mut self ) -> & mut Definitions ;
@@ -351,12 +348,7 @@ impl<'a> LoweringContext<'a> {
351
348
// Otherwise, the base path is an implicit `Self` type path,
352
349
// e.g. `Vec` in `Vec::new` or `<I as Iterator>::Item` in
353
350
// `<I as Iterator>::Item::default`.
354
- let ty = self . ty ( p. span , hir:: TyPath ( hir:: QPath :: Resolved ( qself, path) ) ) ;
355
-
356
- // Associate that innermost path type with the base Def.
357
- self . resolver . record_resolution ( ty. id , resolution. base_def ) ;
358
-
359
- ty
351
+ self . ty ( p. span , hir:: TyPath ( hir:: QPath :: Resolved ( qself, path) ) )
360
352
} ;
361
353
362
354
// Anything after the base path are associated "extensions",
@@ -1902,10 +1894,8 @@ impl<'a> LoweringContext<'a> {
1902
1894
def : def,
1903
1895
segments : hir_vec ! [ hir:: PathSegment :: from_name( id) ] ,
1904
1896
} ) ) ) ;
1905
- let expr = self . expr ( span, expr_path, ThinVec :: new ( ) ) ;
1906
- self . resolver . record_resolution ( expr. id , def) ;
1907
1897
1908
- expr
1898
+ self . expr ( span , expr_path , ThinVec :: new ( ) )
1909
1899
}
1910
1900
1911
1901
fn expr_mut_addr_of ( & mut self , span : Span , e : P < hir:: Expr > ) -> hir:: Expr {
@@ -1918,10 +1908,7 @@ impl<'a> LoweringContext<'a> {
1918
1908
attrs : ThinVec < Attribute > )
1919
1909
-> hir:: Expr {
1920
1910
let path = self . std_path ( span, components, true ) ;
1921
- let def = path. def ;
1922
- let expr = self . expr ( span, hir:: ExprPath ( hir:: QPath :: Resolved ( None , P ( path) ) ) , attrs) ;
1923
- self . resolver . record_resolution ( expr. id , def) ;
1924
- expr
1911
+ self . expr ( span, hir:: ExprPath ( hir:: QPath :: Resolved ( None , P ( path) ) ) , attrs)
1925
1912
}
1926
1913
1927
1914
fn expr_match ( & mut self ,
@@ -1948,11 +1935,8 @@ impl<'a> LoweringContext<'a> {
1948
1935
e : Option < P < hir:: Expr > > ,
1949
1936
attrs : ThinVec < Attribute > ) -> hir:: Expr {
1950
1937
let path = self . std_path ( span, components, false ) ;
1951
- let def = path. def ;
1952
1938
let qpath = hir:: QPath :: Resolved ( None , P ( path) ) ;
1953
- let expr = self . expr ( span, hir:: ExprStruct ( qpath, fields, e) , attrs) ;
1954
- self . resolver . record_resolution ( expr. id , def) ;
1955
- expr
1939
+ self . expr ( span, hir:: ExprStruct ( qpath, fields, e) , attrs)
1956
1940
}
1957
1941
1958
1942
fn expr ( & mut self , span : Span , node : hir:: Expr_ , attrs : ThinVec < Attribute > ) -> hir:: Expr {
@@ -2021,16 +2005,13 @@ impl<'a> LoweringContext<'a> {
2021
2005
subpats : hir:: HirVec < P < hir:: Pat > > )
2022
2006
-> P < hir:: Pat > {
2023
2007
let path = self . std_path ( span, components, true ) ;
2024
- let def = path. def ;
2025
2008
let qpath = hir:: QPath :: Resolved ( None , P ( path) ) ;
2026
2009
let pt = if subpats. is_empty ( ) {
2027
2010
hir:: PatKind :: Path ( qpath)
2028
2011
} else {
2029
2012
hir:: PatKind :: TupleStruct ( qpath, subpats, None )
2030
2013
} ;
2031
- let pat = self . pat ( span, pt) ;
2032
- self . resolver . record_resolution ( pat. id , def) ;
2033
- pat
2014
+ self . pat ( span, pt)
2034
2015
}
2035
2016
2036
2017
fn pat_ident ( & mut self , span : Span , name : Name ) -> P < hir:: Pat > {
@@ -2047,7 +2028,6 @@ impl<'a> LoweringContext<'a> {
2047
2028
let def_index = defs. create_def_with_parent ( parent_def, id, def_path_data) ;
2048
2029
DefId :: local ( def_index)
2049
2030
} ;
2050
- self . resolver . record_resolution ( id, Def :: Local ( def_id) ) ;
2051
2031
2052
2032
P ( hir:: Pat {
2053
2033
id : id,
0 commit comments