Skip to content

Commit 4f8c49e

Browse files
committed
rustc_hir: Relax lifetime requirements on Visitor::visit_path
1 parent 58100c0 commit 4f8c49e

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

clippy_lints/src/from_over_into.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl<'a, 'tcx> Visitor<'tcx> for SelfFinder<'a, 'tcx> {
126126
self.cx.tcx.hir()
127127
}
128128

129-
fn visit_path(&mut self, path: &'tcx Path<'tcx>, _id: HirId) {
129+
fn visit_path(&mut self, path: &Path<'tcx>, _id: HirId) {
130130
for segment in path.segments {
131131
match segment.ident.name {
132132
kw::SelfLower => self.lower.push(segment.ident.span),

clippy_lints/src/methods/option_map_unwrap_or.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ struct UnwrapVisitor<'a, 'tcx> {
9797
impl<'a, 'tcx> Visitor<'tcx> for UnwrapVisitor<'a, 'tcx> {
9898
type NestedFilter = nested_filter::All;
9999

100-
fn visit_path(&mut self, path: &'tcx Path<'_>, _id: HirId) {
100+
fn visit_path(&mut self, path: &Path<'tcx>, _id: HirId) {
101101
self.identifiers.insert(ident(path));
102102
walk_path(self, path);
103103
}
@@ -116,7 +116,7 @@ struct MapExprVisitor<'a, 'tcx> {
116116
impl<'a, 'tcx> Visitor<'tcx> for MapExprVisitor<'a, 'tcx> {
117117
type NestedFilter = nested_filter::All;
118118

119-
fn visit_path(&mut self, path: &'tcx Path<'_>, _id: HirId) {
119+
fn visit_path(&mut self, path: &Path<'tcx>, _id: HirId) {
120120
if self.identifiers.contains(&ident(path)) {
121121
self.found_identifier = true;
122122
return;

clippy_lints/src/utils/internal_lints/lint_without_lint_pass.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ struct LintCollector<'a, 'tcx> {
330330
impl<'a, 'tcx> Visitor<'tcx> for LintCollector<'a, 'tcx> {
331331
type NestedFilter = nested_filter::All;
332332

333-
fn visit_path(&mut self, path: &'tcx Path<'_>, _: HirId) {
333+
fn visit_path(&mut self, path: &Path<'_>, _: HirId) {
334334
if path.segments.len() == 1 {
335335
self.output.insert(path.segments[0].ident.name);
336336
}

clippy_lints/src/utils/internal_lints/metadata_collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ impl<'a, 'hir> intravisit::Visitor<'hir> for ApplicabilityResolver<'a, 'hir> {
10191019
self.cx.tcx.hir()
10201020
}
10211021

1022-
fn visit_path(&mut self, path: &'hir hir::Path<'hir>, _id: hir::HirId) {
1022+
fn visit_path(&mut self, path: &hir::Path<'hir>, _id: hir::HirId) {
10231023
for (index, enum_value) in paths::APPLICABILITY_VALUES.iter().enumerate() {
10241024
if match_path(path, enum_value) {
10251025
self.add_new_index(index);

clippy_utils/src/usage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for BindingUsageFinder<'a, 'tcx> {
128128
}
129129
}
130130

131-
fn visit_path(&mut self, path: &'tcx hir::Path<'tcx>, _: hir::HirId) {
131+
fn visit_path(&mut self, path: &hir::Path<'tcx>, _: hir::HirId) {
132132
if let hir::def::Res::Local(id) = path.res {
133133
if self.binding_ids.contains(&id) {
134134
self.usage_found = true;

0 commit comments

Comments
 (0)