Split hir TyKind and ConstArgKind in two and update hir::Visitor

This commit is contained in:
Boxy
2025-01-11 19:12:36 +00:00
parent 0f10ba60ff
commit 98d80e22d0
48 changed files with 513 additions and 313 deletions

View File

@@ -442,7 +442,7 @@ impl<'a> State<'a> {
self.word("/*ERROR*/");
self.pclose();
}
hir::TyKind::Infer | hir::TyKind::InferDelegation(..) => {
hir::TyKind::Infer(()) | hir::TyKind::InferDelegation(..) => {
self.word("_");
}
hir::TyKind::Pat(ty, pat) => {
@@ -1800,8 +1800,8 @@ impl<'a> State<'a> {
match generic_arg {
GenericArg::Lifetime(lt) if !elide_lifetimes => s.print_lifetime(lt),
GenericArg::Lifetime(_) => {}
GenericArg::Type(ty) => s.print_type(ty),
GenericArg::Const(ct) => s.print_const_arg(ct),
GenericArg::Type(ty) => s.print_type(ty.as_unambig_ty()),
GenericArg::Const(ct) => s.print_const_arg(ct.as_unambig_ct()),
GenericArg::Infer(_inf) => s.word("_"),
}
});
@@ -2151,7 +2151,7 @@ impl<'a> State<'a> {
s.ann.nested(s, Nested::BodyParamPat(body_id, i));
i += 1;
if let hir::TyKind::Infer = ty.kind {
if let hir::TyKind::Infer(()) = ty.kind {
// Print nothing.
} else {
s.word(":");