]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add IdentifierPattern subpattern support for ClosureParamInfer
authorYap Zhi Heng <yapzhhg@gmail.com>
Tue, 12 Aug 2025 14:02:08 +0000 (22:02 +0800)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 30 Oct 2025 19:58:40 +0000 (20:58 +0100)
gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-pattern.cc(ClosureParamInfer(IdentifierPattern)):
Resolve subpattern types for IdentifierPattern.

Signed-off-by: Yap Zhi Heng <yapzhhg@gmail.com>
gcc/rust/typecheck/rust-hir-type-check-pattern.cc

index 0930c2233e63d6b2d6fee72accd6b1e5438e1eec..b34679eb6b40f94750c3da55855f7eb72aaa054a 100644 (file)
@@ -814,6 +814,11 @@ ClosureParamInfer::visit (HIR::WildcardPattern &pattern)
 void
 ClosureParamInfer::visit (HIR::IdentifierPattern &pattern)
 {
+  if (pattern.has_subpattern ())
+    {
+      ClosureParamInfer::Resolve (pattern.get_subpattern ());
+    }
+
   HirId id = pattern.get_mappings ().get_hirid ();
   infered = new TyTy::InferType (id, TyTy::InferType::InferTypeKind::GENERAL,
                                 TyTy::InferType::TypeHint::Default (),