mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Rollup merge of #154931 - aerooneqq:delegation-small-cleanup, r=petrochenkov
delegation(small cleanup): remove not needed PhantomData r? @petrochenkov
This commit is contained in:
@@ -37,7 +37,6 @@
|
||||
//! also be emitted during HIR ty lowering.
|
||||
|
||||
use std::iter;
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use ast::visit::Visitor;
|
||||
use hir::def::{DefKind, PartialRes, Res};
|
||||
@@ -418,7 +417,6 @@ fn lower_delegation_body(
|
||||
resolver: this.resolver,
|
||||
path_id: delegation.id,
|
||||
self_param_id: pat_node_id,
|
||||
phantom: PhantomData,
|
||||
};
|
||||
self_resolver.visit_block(block);
|
||||
// Target expr needs to lower `self` path.
|
||||
@@ -669,14 +667,13 @@ fn mk_expr(&mut self, kind: hir::ExprKind<'hir>, span: Span) -> hir::Expr<'hir>
|
||||
}
|
||||
}
|
||||
|
||||
struct SelfResolver<'a, 'tcx, R> {
|
||||
struct SelfResolver<'a, R> {
|
||||
resolver: &'a mut R,
|
||||
path_id: NodeId,
|
||||
self_param_id: NodeId,
|
||||
phantom: PhantomData<&'tcx ()>,
|
||||
}
|
||||
|
||||
impl<'tcx, R: ResolverAstLoweringExt<'tcx>> SelfResolver<'_, 'tcx, R> {
|
||||
impl<'tcx, R: ResolverAstLoweringExt<'tcx>> SelfResolver<'_, R> {
|
||||
fn try_replace_id(&mut self, id: NodeId) {
|
||||
if let Some(res) = self.resolver.get_partial_res(id)
|
||||
&& let Some(Res::Local(sig_id)) = res.full_res()
|
||||
@@ -688,7 +685,7 @@ fn try_replace_id(&mut self, id: NodeId) {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ast, 'a, 'tcx, R: ResolverAstLoweringExt<'tcx>> Visitor<'ast> for SelfResolver<'a, 'tcx, R> {
|
||||
impl<'ast, 'tcx, R: ResolverAstLoweringExt<'tcx>> Visitor<'ast> for SelfResolver<'_, R> {
|
||||
fn visit_id(&mut self, id: NodeId) {
|
||||
self.try_replace_id(id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user