Use hir_id instead of fetching hir_id via the NodeId

This commit is contained in:
Oliver Schneider 2017-09-09 14:06:41 +02:00
parent 8adc42b5b4
commit edcf6e7e80
No known key found for this signature in database
GPG Key ID: 1D5CB4FC597C3004

View File

@ -360,7 +360,7 @@ fn print_item(cx: &LateContext, item: &hir::Item) {
}
match item.node {
hir::ItemExternCrate(ref _renamed_from) => {
if let Some(crate_id) = cx.tcx.extern_mod_stmt_cnum(cx.tcx.hir.node_to_hir_id(item.id)) {
if let Some(crate_id) = cx.tcx.extern_mod_stmt_cnum(item.hir_id) {
let source = cx.tcx.used_crate_source(crate_id);
if let Some(ref src) = source.dylib {
println!("extern crate dylib source: {:?}", src.0);