diff options
| author | bors <bors@rust-lang.org> | 2022-09-14 05:21:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-09-14 05:21:14 +0000 |
| commit | a0d1df4a5d6ed476e02ad46031dfcdb123fc0e84 (patch) | |
| tree | 2ef5cd9fbe79ec1310bb3c1622033710115c551d /compiler/rustc_resolve/src | |
| parent | a5b58addae4d629734ebbfc9c69f4e0653b99569 (diff) | |
| parent | b8ed1c5745ab2fe80b216b00cd68def6d2a2aae9 (diff) | |
| download | rust-a0d1df4a5d6ed476e02ad46031dfcdb123fc0e84.tar.gz rust-a0d1df4a5d6ed476e02ad46031dfcdb123fc0e84.zip | |
Auto merge of #101709 - nnethercote:simplify-visitors-more, r=cjgillot
Simplify visitors more A successor to #100392. r? `@cjgillot`
Diffstat (limited to 'compiler/rustc_resolve/src')
| -rw-r--r-- | compiler/rustc_resolve/src/def_collector.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_resolve/src/late.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_resolve/src/late/lifetimes.rs | 10 |
3 files changed, 9 insertions, 13 deletions
diff --git a/compiler/rustc_resolve/src/def_collector.rs b/compiler/rustc_resolve/src/def_collector.rs index 5955d8df16e..3f88f44ff21 100644 --- a/compiler/rustc_resolve/src/def_collector.rs +++ b/compiler/rustc_resolve/src/def_collector.rs @@ -154,7 +154,7 @@ impl<'a, 'b> visit::Visitor<'a> for DefCollector<'a, 'b> { } } - visit::walk_fn(self, fn_kind, span); + visit::walk_fn(self, fn_kind); } fn visit_use_tree(&mut self, use_tree: &'a UseTree, id: NodeId, _nested: bool) { diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index 2d6e76c451b..0aea90bb5aa 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -1030,7 +1030,7 @@ impl<'a: 'ast, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> { if let Some(ref gen_args) = constraint.gen_args { // Forbid anonymous lifetimes in GAT parameters until proper semantics are decided. self.with_lifetime_rib(LifetimeRibKind::AnonymousReportError, |this| { - this.visit_generic_args(gen_args.span(), gen_args) + this.visit_generic_args(gen_args) }); } match constraint.kind { @@ -1044,10 +1044,10 @@ impl<'a: 'ast, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> { } } - fn visit_path_segment(&mut self, path_span: Span, path_segment: &'ast PathSegment) { + fn visit_path_segment(&mut self, path_segment: &'ast PathSegment) { if let Some(ref args) = path_segment.args { match &**args { - GenericArgs::AngleBracketed(..) => visit::walk_generic_args(self, path_span, args), + GenericArgs::AngleBracketed(..) => visit::walk_generic_args(self, args), GenericArgs::Parenthesized(p_args) => { // Probe the lifetime ribs to know how to behave. for rib in self.lifetime_ribs.iter().rev() { @@ -1078,7 +1078,7 @@ impl<'a: 'ast, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> { // We have nowhere to introduce generics. Code is malformed, // so use regular lifetime resolution to avoid spurious errors. LifetimeRibKind::Item | LifetimeRibKind::Generics { .. } => { - visit::walk_generic_args(self, path_span, args); + visit::walk_generic_args(self, args); break; } LifetimeRibKind::AnonymousCreateParameter { .. } @@ -3798,7 +3798,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> { for argument in arguments { self.resolve_expr(argument, None); } - self.visit_path_segment(expr.span, segment); + self.visit_path_segment(segment); } ExprKind::Call(ref callee, ref arguments) => { diff --git a/compiler/rustc_resolve/src/late/lifetimes.rs b/compiler/rustc_resolve/src/late/lifetimes.rs index 6ff56f9a891..4d970461712 100644 --- a/compiler/rustc_resolve/src/late/lifetimes.rs +++ b/compiler/rustc_resolve/src/late/lifetimes.rs @@ -682,7 +682,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { let scope = Scope::TraitRefBoundary { s: self.scope }; self.with(scope, |this| { for bound in bounds { - this.visit_poly_trait_ref(bound, hir::TraitBoundModifier::None); + this.visit_poly_trait_ref(bound); } }); match lifetime.name { @@ -1105,11 +1105,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { } } - fn visit_poly_trait_ref( - &mut self, - trait_ref: &'tcx hir::PolyTraitRef<'tcx>, - _modifier: hir::TraitBoundModifier, - ) { + fn visit_poly_trait_ref(&mut self, trait_ref: &'tcx hir::PolyTraitRef<'tcx>) { debug!("visit_poly_trait_ref(trait_ref={:?})", trait_ref); let (mut binders, scope_type) = self.poly_trait_ref_binder_info(); @@ -1827,7 +1823,7 @@ fn is_late_bound_map(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<&FxIndexSet< // is, those would be potentially inputs to // projections if let Some(last_segment) = path.segments.last() { - self.visit_path_segment(path.span, last_segment); + self.visit_path_segment(last_segment); } } |
