rustc_hir: Relax lifetime requirements on Visitor::visit_path

This commit is contained in:
Vadim Petrochenkov 2022-11-25 11:26:36 +03:00
parent 58100c014a
commit 4f8c49e950
5 changed files with 6 additions and 6 deletions

View File

@ -126,7 +126,7 @@ fn nested_visit_map(&mut self) -> Self::Map {
self.cx.tcx.hir()
}
fn visit_path(&mut self, path: &'tcx Path<'tcx>, _id: HirId) {
fn visit_path(&mut self, path: &Path<'tcx>, _id: HirId) {
for segment in path.segments {
match segment.ident.name {
kw::SelfLower => self.lower.push(segment.ident.span),

View File

@ -97,7 +97,7 @@ struct UnwrapVisitor<'a, 'tcx> {
impl<'a, 'tcx> Visitor<'tcx> for UnwrapVisitor<'a, 'tcx> {
type NestedFilter = nested_filter::All;
fn visit_path(&mut self, path: &'tcx Path<'_>, _id: HirId) {
fn visit_path(&mut self, path: &Path<'tcx>, _id: HirId) {
self.identifiers.insert(ident(path));
walk_path(self, path);
}
@ -116,7 +116,7 @@ struct MapExprVisitor<'a, 'tcx> {
impl<'a, 'tcx> Visitor<'tcx> for MapExprVisitor<'a, 'tcx> {
type NestedFilter = nested_filter::All;
fn visit_path(&mut self, path: &'tcx Path<'_>, _id: HirId) {
fn visit_path(&mut self, path: &Path<'tcx>, _id: HirId) {
if self.identifiers.contains(&ident(path)) {
self.found_identifier = true;
return;

View File

@ -330,7 +330,7 @@ struct LintCollector<'a, 'tcx> {
impl<'a, 'tcx> Visitor<'tcx> for LintCollector<'a, 'tcx> {
type NestedFilter = nested_filter::All;
fn visit_path(&mut self, path: &'tcx Path<'_>, _: HirId) {
fn visit_path(&mut self, path: &Path<'_>, _: HirId) {
if path.segments.len() == 1 {
self.output.insert(path.segments[0].ident.name);
}

View File

@ -1019,7 +1019,7 @@ fn nested_visit_map(&mut self) -> Self::Map {
self.cx.tcx.hir()
}
fn visit_path(&mut self, path: &'hir hir::Path<'hir>, _id: hir::HirId) {
fn visit_path(&mut self, path: &hir::Path<'hir>, _id: hir::HirId) {
for (index, enum_value) in paths::APPLICABILITY_VALUES.iter().enumerate() {
if match_path(path, enum_value) {
self.add_new_index(index);

View File

@ -128,7 +128,7 @@ fn visit_expr(&mut self, expr: &'tcx hir::Expr<'tcx>) {
}
}
fn visit_path(&mut self, path: &'tcx hir::Path<'tcx>, _: hir::HirId) {
fn visit_path(&mut self, path: &hir::Path<'tcx>, _: hir::HirId) {
if let hir::def::Res::Local(id) = path.res {
if self.binding_ids.contains(&id) {
self.usage_found = true;