From 721549569c43694dd95012291117320e5a0ef792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 15 Apr 2020 13:44:28 +0200 Subject: [PATCH 1/2] rustup https://github.com/rust-lang/rust/pull/71116 --- clippy_lints/src/utils/author.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clippy_lints/src/utils/author.rs b/clippy_lints/src/utils/author.rs index 0c8f06da9bb3b..5f72559f1933d 100644 --- a/clippy_lints/src/utils/author.rs +++ b/clippy_lints/src/utils/author.rs @@ -97,7 +97,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Author { return; } prelude(); - PrintVisitor::new("var").visit_variant(var, &hir::Generics::empty(), hir::DUMMY_HIR_ID); + let dummy_hir_id = cx.tcx.hir().get_parent_node(var.id); + PrintVisitor::new("var").visit_variant(var, &hir::Generics::empty(), dummy_hir_id); done(); } From a353f0f174d45f6183b4b868efc170bac60ca209 Mon Sep 17 00:00:00 2001 From: Philipp Krones Date: Wed, 15 Apr 2020 19:46:05 +0200 Subject: [PATCH 2/2] Rename dummy_hir_id -> parent_hir_id --- clippy_lints/src/utils/author.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clippy_lints/src/utils/author.rs b/clippy_lints/src/utils/author.rs index 5f72559f1933d..74601008dca41 100644 --- a/clippy_lints/src/utils/author.rs +++ b/clippy_lints/src/utils/author.rs @@ -97,8 +97,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Author { return; } prelude(); - let dummy_hir_id = cx.tcx.hir().get_parent_node(var.id); - PrintVisitor::new("var").visit_variant(var, &hir::Generics::empty(), dummy_hir_id); + let parent_hir_id = cx.tcx.hir().get_parent_node(var.id); + PrintVisitor::new("var").visit_variant(var, &hir::Generics::empty(), parent_hir_id); done(); }