From d1ddf002935efedb3fcb4a28aa580afd3d1f88a6 Mon Sep 17 00:00:00 2001 From: CanardMandarin Date: Sun, 7 May 2023 11:03:37 +0200 Subject: [PATCH] lang: Fix incorrectly checking the first init constraint (#2483) --- lang/syn/src/parser/accounts/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/syn/src/parser/accounts/mod.rs b/lang/syn/src/parser/accounts/mod.rs index d0c8aee763..19a525b8b5 100644 --- a/lang/syn/src/parser/accounts/mod.rs +++ b/lang/syn/src/parser/accounts/mod.rs @@ -162,7 +162,7 @@ fn constraints_cross_checks(fields: &[AccountField]) -> ParseResult<()> { )); } } - match kind { + match &field.constraints.init.as_ref().unwrap().kind { // This doesn't catch cases like account.key() or account.key. // My guess is that doesn't happen often and we can revisit // this if I'm wrong.