From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 573FF388A034 for ; Fri, 23 Jul 2021 11:23:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 573FF388A034 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x331.google.com with SMTP id o5-20020a1c4d050000b02901fc3a62af78so3287895wmh.3 for ; Fri, 23 Jul 2021 04:23:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=TeuFRNKe5ZPU0mSp19OH7tFHE2nL28G8wzq6N/Lr4vg=; b=cRXkPGEndSg87kDSZbn7Go+N7WvzFtoYNqS3+sFpSBzgkIWRh2ygPQQl2lq6jk7ryA UPQ9DqO+yfKYwFr3VFyaVMb4h0PEWRu97OnxswT85PI6dzlaocQqpihycMwpu96T1Nnx M/MD5j7YPXhbBG7i0tpdYrv53i/o9J4Fu5KpG1VA8nY2xAnYjfbPUjGjmwaznCkQGr6Q /ZIVdVDYmgIss1I1rzUWNIdoWJeU6Wq8USldI+2tom09Zm/ykoMio3bm7C5w7nPF0ITY 7ylnPXTY2OCYWDiTL8DiacmPRoxI/46tZ5u/VZU6G98Jrl0lKZrWNCw2EBAzNv7wZxce 8yeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=TeuFRNKe5ZPU0mSp19OH7tFHE2nL28G8wzq6N/Lr4vg=; b=eqpRW6XbFLqkdwmFX5wwLkFqPfQ3arL8MySAo0Hj1SRvSydnVqKKDSwCX3tcj6kM8q xQGjXnybKlXpSE6H+P26jWn5AsOiWA2+RXATwdMId2vIWLwfD4iBT/IfomnTg/Jl6Qpr iN7yuJ0az7UvqfYLKpQPohUjnw+CIZ4QbZJuwKNssC81MzizsT3laaZLqFm/+Oj+edDU hPqWtI3tTjAGOySBE/bmU0NY0fRB0h+NnWurWAahZcf8qYs1jt9hCiqa2Wd7OKOCRSUy Cx4HR0VxqXPoyI5xWyS4p3vebnsESgLwlTAgqbtLW97aC7snC5l1+bD0w87f+H2S2RuR h+EA== X-Gm-Message-State: AOAM5334pDIx2r5w5ORW9bZ1fNVVQ0hBwGNcQSo79tPCfV39uVk9zSIn f9bfBsiNV1TJWdpKciCHq4rw79mAksMX/w== X-Google-Smtp-Source: ABdhPJywlSyv0IJSoAqhMP0MT4YsSbsDZIVrFqbmjcBWi7jXRQ1hmu6rbnjpVMDdVSGCYHW0y9ClwA== X-Received: by 2002:a05:600c:4982:: with SMTP id h2mr4094726wmp.184.1627039420068; Fri, 23 Jul 2021 04:23:40 -0700 (PDT) Received: from [192.168.0.40] ([86.14.124.218]) by smtp.gmail.com with ESMTPSA id r17sm4735502wmq.13.2021.07.23.04.23.39 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Jul 2021 04:23:39 -0700 (PDT) Subject: Re: Using unsafe blocks in let expressions To: gcc-rust@gcc.gnu.org References: From: Philip Herron Message-ID: <36a1be0c-7c7c-ffe4-c7a7-ebde08d33af0@embecosm.com> Date: Fri, 23 Jul 2021 12:23:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gw74FwAvthDQa09LDqmNgkzdsL4JGD5Qn" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Fri, 23 Jul 2021 11:23:42 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gw74FwAvthDQa09LDqmNgkzdsL4JGD5Qn Content-Type: multipart/mixed; boundary="Yiq59QuIS9QzdMvpJmdgaXsMZiTQm7Etd"; protected-headers="v1" From: Philip Herron To: gcc-rust@gcc.gnu.org Message-ID: <36a1be0c-7c7c-ffe4-c7a7-ebde08d33af0@embecosm.com> Subject: Re: Using unsafe blocks in let expressions References: In-Reply-To: --Yiq59QuIS9QzdMvpJmdgaXsMZiTQm7Etd Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Content-Language: en-US On 22/07/2021 00:09, Mark Wielaard wrote: > On Wed, Jul 21, 2021 at 11:09:38PM +0200, Mark Wielaard wrote: >> + Location locus; >> + if (!pratt_parse) >> + { >> + Location locus =3D lexer.peek_token ()->get_locus (); > Oops, shadowed locus. Fixed patch attached, and also at > https://code.wildebeest.org/git/user/mjw/gccrs/commit/?h=3Dlet-unsafe > > > This was merged yesterday https://github.com/Rust-GCC/gccrs/pull/582 I also merged a simple test case to show the parser is working https://github.com/Rust-GCC/gccrs/pull/587 The final PR relating to this was: https://github.com/Rust-GCC/gccrs/pull/589 in the type checker assumed all dereference expressions were going to be for ReferenceTypes but this extended it to support pointers. Some work is needed to ensure derferences and union access outside of match expressions will emit an error but this is a fairly simple change to make I will update a guide on how to do this later. Thanks again --Phil --Yiq59QuIS9QzdMvpJmdgaXsMZiTQm7Etd-- --gw74FwAvthDQa09LDqmNgkzdsL4JGD5Qn Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsD5BAABCAAjFiEET83ATZOayqRjyL0Cr7gxHEFOdpkFAmD6proFAwAAAAAACgkQr7gxHEFOdpke TQv/U4js+ZxWu7abHdI1Etmp8mRHGZAih6Q1zIuc/RjBaqsrUj3SMDcFziW+9KKPytzHjtcEdCCN syRcSOJQVBye9GoWMaAtdv5at5VbbbPI0mxdhnVtplX1nXc/lGrfsBDyM/Iae18UK4PU/qvn+iZg cCHomdJKuSn6mgPrKuPSYHkzx97lp9wOtrKye0awyLkxlULqgGL+4ivboacjsI9gOkPQWwSNIcux WMqgMhWwSGuJoK6xs+JyowUo1QfNRyVMIWCsMQwlZtYdCeuJy3W0qh76bF92iWU7Fz851xl2qGiV Am8rFrpF3Rmwgl6VXBde/zRWfYCjNQUiQm5iA9+gNkQ+S8iSTg0AuEzMUjPqcN8IjGdWNPYfABu3 /OrrR4mVyImTxm1fzQjan0yW1aBx0gD02fP6bHz/+xf7gH4YqIoabJohwkDp7TeIyeZaM+BvAMAE v4FTLvaSo/swQ0gcm+VxtjRdAqFQc1IEKMrRCOgnmHmo23hRy+OvVj3LPTNA =vdSA -----END PGP SIGNATURE----- --gw74FwAvthDQa09LDqmNgkzdsL4JGD5Qn--