From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (wildebeest.demon.nl [212.238.236.112]) by sourceware.org (Postfix) with ESMTPS id 0CF9F386FC1B for ; Wed, 23 Jun 2021 16:06:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0CF9F386FC1B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from tarox.wildebeest.org (83-87-18-245.cable.dynamic.v4.ziggo.nl [83.87.18.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 893953000346; Wed, 23 Jun 2021 18:06:36 +0200 (CEST) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id B8B9B40441B5; Wed, 23 Jun 2021 18:06:35 +0200 (CEST) Message-ID: Subject: Re: tuple indexes From: Mark Wielaard To: Philip Herron , gcc-rust@gcc.gnu.org Date: Wed, 23 Jun 2021 18:06:35 +0200 In-Reply-To: <8e2ce8ca-ff1d-4b25-d3bf-f4f523edef03@embecosm.com> References: <2f353271-7ee6-ab21-e862-69582a503627@embecosm.com> <8e2ce8ca-ff1d-4b25-d3bf-f4f523edef03@embecosm.com> Content-Type: multipart/mixed; boundary="=-UEvjEF+Vqpwdj1XXiSnM" X-Mailer: Evolution 3.28.5 (3.28.5-10.el7) Mime-Version: 1.0 X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-rust@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: gcc-rust mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2021 16:06:39 -0000 --=-UEvjEF+Vqpwdj1XXiSnM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Philip, On Wed, 2021-06-23 at 10:55 +0100, Philip Herron wrote: > Small update, I think part of this issue is that the support for > unit-structs is not there yet in the compiler, so if you remove the unit > tuple struct and move the other struct definitions outside of the block > the test case works: https://godbolt.org/z/nb84sEaE4 >=20 > It might be enough to help with testing your tuple index fixes. Very nice. That workaround helps me get unblocked, except for testing empty struct tuples (unit-structs). But I have a patch for that, and even included a testcase to proof the parser now handles them. See attached. Cheers, Mark --=-UEvjEF+Vqpwdj1XXiSnM Content-Disposition: inline; filename="0001-Handle-empty-unit-tuple-structs-in-the-parser.patch" Content-Transfer-Encoding: base64 Content-Type: text/x-patch; name="0001-Handle-empty-unit-tuple-structs-in-the-parser.patch"; charset="UTF-8" RnJvbSBhMWQwM2I1MTgyZjdlMmIxNmI1MjAxNDU5Yzk4YjMzYTEyNzc1ODg4IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBNYXJrIFdpZWxhYXJkIDxtYXJrQGtsb21wLm9yZz4KRGF0ZTog V2VkLCAyMyBKdW4gMjAyMSAxNzo1OTozMCArMDIwMApTdWJqZWN0OiBbUEFUQ0hdIEhhbmRsZSBl bXB0eS91bml0IHR1cGxlIHN0cnVjdHMgaW4gdGhlIHBhcnNlci4KCkEgdHVwbGUgc3RydWN0IGNh biBiZSBlbXB0eSwgaW4gd2hpY2ggY2FzZSBpdCBpcyBhIHVuaXQgdHVwbGUgc3RydWN0LgpIYW5k bGUgdGhpcyBpbiBQYXJzZXI8TWFuYWdlZFRva2VuU291cmNlPjo6cGFyc2Vfc3RydWN0IGJ5IGNy ZWF0aW5nCmEgZW1wdHkgdHVwbGVfZmllbGQgdmVjdG9yIGluc3RlYWQgb2YgY2FsbGluZyBwYXJz ZV90dXBsZV9maWVsZHMuCgpBZGQgYSB0ZXN0Y2FzZSB0byBzaG93IGVtc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