@@ -82,9 +82,6 @@ pub trait Resolver {
8282 // Obtain the resolution for a node id
8383 fn get_resolution ( & mut self , id : NodeId ) -> Option < PathResolution > ;
8484
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-
8885 // We must keep the set of definitions up to date as we add nodes that weren't in the AST.
8986 // This should only return `None` during testing.
9087 fn definitions ( & mut self ) -> & mut Definitions ;
@@ -351,12 +348,7 @@ impl<'a> LoweringContext<'a> {
351348 // Otherwise, the base path is an implicit `Self` type path,
352349 // e.g. `Vec` in `Vec::new` or `<I as Iterator>::Item` in
353350 // `<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) ) )
360352 } ;
361353
362354 // Anything after the base path are associated "extensions",
@@ -1902,10 +1894,8 @@ impl<'a> LoweringContext<'a> {
19021894 def : def,
19031895 segments : hir_vec ! [ hir:: PathSegment :: from_name( id) ] ,
19041896 } ) ) ) ;
1905- let expr = self . expr ( span, expr_path, ThinVec :: new ( ) ) ;
1906- self . resolver . record_resolution ( expr. id , def) ;
19071897
1908- expr
1898+ self . expr ( span , expr_path , ThinVec :: new ( ) )
19091899 }
19101900
19111901 fn expr_mut_addr_of ( & mut self , span : Span , e : P < hir:: Expr > ) -> hir:: Expr {
@@ -1918,10 +1908,7 @@ impl<'a> LoweringContext<'a> {
19181908 attrs : ThinVec < Attribute > )
19191909 -> hir:: Expr {
19201910 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)
19251912 }
19261913
19271914 fn expr_match ( & mut self ,
@@ -1948,11 +1935,8 @@ impl<'a> LoweringContext<'a> {
19481935 e : Option < P < hir:: Expr > > ,
19491936 attrs : ThinVec < Attribute > ) -> hir:: Expr {
19501937 let path = self . std_path ( span, components, false ) ;
1951- let def = path. def ;
19521938 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)
19561940 }
19571941
19581942 fn expr ( & mut self , span : Span , node : hir:: Expr_ , attrs : ThinVec < Attribute > ) -> hir:: Expr {
@@ -2021,16 +2005,13 @@ impl<'a> LoweringContext<'a> {
20212005 subpats : hir:: HirVec < P < hir:: Pat > > )
20222006 -> P < hir:: Pat > {
20232007 let path = self . std_path ( span, components, true ) ;
2024- let def = path. def ;
20252008 let qpath = hir:: QPath :: Resolved ( None , P ( path) ) ;
20262009 let pt = if subpats. is_empty ( ) {
20272010 hir:: PatKind :: Path ( qpath)
20282011 } else {
20292012 hir:: PatKind :: TupleStruct ( qpath, subpats, None )
20302013 } ;
2031- let pat = self . pat ( span, pt) ;
2032- self . resolver . record_resolution ( pat. id , def) ;
2033- pat
2014+ self . pat ( span, pt)
20342015 }
20352016
20362017 fn pat_ident ( & mut self , span : Span , name : Name ) -> P < hir:: Pat > {
@@ -2047,7 +2028,6 @@ impl<'a> LoweringContext<'a> {
20472028 let def_index = defs. create_def_with_parent ( parent_def, id, def_path_data) ;
20482029 DefId :: local ( def_index)
20492030 } ;
2050- self . resolver . record_resolution ( id, Def :: Local ( def_id) ) ;
20512031
20522032 P ( hir:: Pat {
20532033 id : id,
0 commit comments