Remove not needed PhantomData

This commit is contained in:
aerooneqq
2026-04-07 10:37:23 +03:00
parent bcded33165
commit 7f06f55bc2
@@ -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};
@@ -420,7 +419,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.
@@ -673,14 +671,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()
@@ -692,7 +689,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);
}