// warn on lints, that are included in `rust-lang/rust`s bootstrap
#![warn(rust_2018_idioms, unused_lifetimes)]
++// The `rustc_driver` crate seems to be required in order to use the `rust_lexer` crate.
++#[allow(unused_extern_crates)]
++extern crate rustc_driver;
extern crate rustc_lexer;
use std::path::PathBuf;
fn get_parent_local_hir_id<'hir>(cx: &LateContext<'hir>, hir_id: hir::HirId) -> Option<&'hir hir::Local<'hir>> {
let map = cx.tcx.hir();
- match map.find_parent((hir_id)) {
- match map.find(map.get_parent_node(hir_id)) {
++ match map.find_parent(hir_id) {
Some(hir::Node::Local(local)) => Some(local),
Some(hir::Node::Pat(pattern)) => get_parent_local_hir_id(cx, pattern.hir_id),
_ => None,