1
Fork 0

Add a TyPat in the AST to reuse the generic arg lowering logic

This commit is contained in:
Oli Scherer 2025-02-06 13:48:12 +00:00
parent c182ce9cbc
commit 6d7ce4e893
21 changed files with 241 additions and 264 deletions

View file

@ -923,6 +923,21 @@ impl<'ra: 'ast, 'ast, 'tcx> Visitor<'ast> for LateResolutionVisitor<'_, 'ast, 'r
self.diag_metadata.current_trait_object = prev;
self.diag_metadata.current_type_path = prev_ty;
}
fn visit_ty_pat(&mut self, t: &'ast TyPat) -> Self::Result {
match &t.kind {
TyPatKind::Range(start, end, _) => {
if let Some(start) = start {
self.resolve_anon_const(start, AnonConstKind::ConstArg(IsRepeatExpr::No));
}
if let Some(end) = end {
self.resolve_anon_const(end, AnonConstKind::ConstArg(IsRepeatExpr::No));
}
}
TyPatKind::Err(_) => {}
}
}
fn visit_poly_trait_ref(&mut self, tref: &'ast PolyTraitRef) {
let span = tref.span.shrink_to_lo().to(tref.trait_ref.path.span.shrink_to_lo());
self.with_generic_param_rib(