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;
15
15
use crate :: hir:: map;
16
16
use crate :: hir:: { Expr , FnDecl , Node } ;
17
17
use crate :: hir:: intravisit:: FnKind ;
18
- use syntax:: ast:: { Attribute , Ident , NodeId } ;
18
+ use syntax:: ast:: { Attribute , Ident } ;
19
19
use syntax_pos:: Span ;
20
20
21
21
/// An FnLikeNode is a Node that is like a fn, in that it has a decl
@@ -83,11 +83,11 @@ impl<'a> Code<'a> {
83
83
}
84
84
85
85
/// 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) {
88
88
map:: Node :: Block ( _) => {
89
89
// 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) )
91
91
}
92
92
map:: Node :: Expr ( expr) => Some ( Code :: Expr ( expr) ) ,
93
93
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>(
909
909
tcx. sess . fatal ( & format ! ( "--pretty flowgraph couldn't find id: {}" , nodeid) )
910
910
} ) ;
911
911
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) {
913
914
Some ( code) => {
914
915
let variants = gather_flowgraph_variants ( tcx. sess ) ;
915
916
You can’t perform that action at this time.
0 commit comments