diff options
| author | ljedrz <ljedrz@gmail.com> | 2019-06-24 09:55:11 +0200 |
|---|---|---|
| committer | ljedrz <ljedrz@gmail.com> | 2019-06-24 09:55:11 +0200 |
| commit | 90de9edce576d03bd6e7e5d294fa44d8d1ef8a5a (patch) | |
| tree | c199d524760b5a905b0b2b885659da7b1fe244bf /src/librustc_driver | |
| parent | d08bd72e977d05f7fe6d1140e10d7311f64f0f21 (diff) | |
| download | rust-90de9edce576d03bd6e7e5d294fa44d8d1ef8a5a.tar.gz rust-90de9edce576d03bd6e7e5d294fa44d8d1ef8a5a.zip | |
HIR: remove the NodeId find
Diffstat (limited to 'src/librustc_driver')
| -rw-r--r-- | src/librustc_driver/pretty.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_driver/pretty.rs b/src/librustc_driver/pretty.rs index 1b78f77e4f9..ff0e6aacef1 100644 --- a/src/librustc_driver/pretty.rs +++ b/src/librustc_driver/pretty.rs @@ -907,11 +907,11 @@ fn print_with_analysis<'tcx>( let nodeid = nodeid.expect("`pretty flowgraph=..` needs NodeId (int) or unique path \ suffix (b::c::d)"); - let node = tcx.hir().find(nodeid).unwrap_or_else(|| { + let hir_id = tcx.hir().node_to_hir_id(nodeid); + let node = tcx.hir().find_by_hir_id(hir_id).unwrap_or_else(|| { tcx.sess.fatal(&format!("--pretty flowgraph couldn't find id: {}", nodeid)) }); - let hir_id = tcx.hir().node_to_hir_id(nodeid); match blocks::Code::from_node(&tcx.hir(), hir_id) { Some(code) => { let variants = gather_flowgraph_variants(tcx.sess); |
