find_by_hir_id -> find

This commit is contained in:
Manish Goregaokar
2019-06-25 14:34:07 -07:00
parent c47a7e4ef2
commit d744dcdaaf
10 changed files with 17 additions and 17 deletions

View File

@@ -63,7 +63,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoxedLocal {
) {
// If the method is an impl for a trait, don't warn.
let parent_id = cx.tcx.hir().get_parent_item(hir_id);
let parent_node = cx.tcx.hir().find_by_hir_id(parent_id);
let parent_node = cx.tcx.hir().find(parent_id);
if let Some(Node::Item(item)) = parent_node {
if let ItemKind::Impl(_, _, _, _, Some(..), _, _) = item.node {
@@ -115,7 +115,7 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
let map = &self.cx.tcx.hir();
if map.is_argument(map.hir_to_node_id(consume_pat.hir_id)) {
// Skip closure arguments
if let Some(Node::Expr(..)) = map.find_by_hir_id(map.get_parent_node(consume_pat.hir_id)) {
if let Some(Node::Expr(..)) = map.find(map.get_parent_node(consume_pat.hir_id)) {
return;
}
if is_non_trait_box(cmt.ty) && !self.is_large_box(cmt.ty) {
@@ -124,7 +124,7 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
return;
}
if let Categorization::Rvalue(..) = cmt.cat {
if let Some(Node::Stmt(st)) = map.find_by_hir_id(map.get_parent_node(cmt.hir_id)) {
if let Some(Node::Stmt(st)) = map.find(map.get_parent_node(cmt.hir_id)) {
if let StmtKind::Local(ref loc) = st.node {
if let Some(ref ex) = loc.init {
if let ExprKind::Box(..) = ex.node {