File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ use crate::hir as ast;
1515use crate :: hir:: map;
1616use crate :: hir:: { Expr , FnDecl , Node } ;
1717use crate :: hir:: intravisit:: FnKind ;
18- use syntax:: ast:: { Attribute , Ident , NodeId } ;
18+ use syntax:: ast:: { Attribute , Ident } ;
1919use syntax_pos:: Span ;
2020
2121/// An FnLikeNode is a Node that is like a fn, in that it has a decl
@@ -83,11 +83,11 @@ impl<'a> Code<'a> {
8383 }
8484
8585 /// Attempts to construct a Code from presumed FnLike or Expr node input.
86- pub fn from_node ( map : & map:: Map < ' a > , id : NodeId ) -> Option < Code < ' a > > {
87- match map. get ( id) {
86+ pub fn from_node ( map : & map:: Map < ' a > , id : ast :: HirId ) -> Option < Code < ' a > > {
87+ match map. get_by_hir_id ( id) {
8888 map:: Node :: Block ( _) => {
8989 // Use the parent, hopefully an expression node.
90- Code :: from_node ( map, map. get_parent_node ( id) )
90+ Code :: from_node ( map, map. get_parent_node_by_hir_id ( id) )
9191 }
9292 map:: Node :: Expr ( expr) => Some ( Code :: Expr ( expr) ) ,
9393 node => FnLikeNode :: from_node ( node) . map ( Code :: FnLike )
Original file line number Diff line number Diff line change @@ -909,7 +909,8 @@ fn print_with_analysis<'tcx>(
909909 tcx. sess . fatal ( & format ! ( "--pretty flowgraph couldn't find id: {}" , nodeid) )
910910 } ) ;
911911
912- match blocks:: Code :: from_node ( & tcx. hir ( ) , nodeid) {
912+ let hir_id = tcx. hir ( ) . node_to_hir_id ( nodeid) ;
913+ match blocks:: Code :: from_node ( & tcx. hir ( ) , hir_id) {
913914 Some ( code) => {
914915 let variants = gather_flowgraph_variants ( tcx. sess ) ;
915916
You can’t perform that action at this time.
0 commit comments