Rust: Work around 'error[E0658]: `let...else` statements are unstable'

Arthur Cohen arthur.cohen@embecosm.com
Mon Nov 25 10:24:08 GMT 2024


Hi Thomas!

Thanks, this patch (and your other one on the matter) looks good but I 
have a slight issue with it. We had previously done something similar to 
adapt to Rust 1.72 when we originally reused the format_args parser:

https://github.com/Rust-GCC/gccrs/pull/2964

This was later reverted because a GSoC student needed some nightly 
features. I would rather re-apply this entire patch, lower our Rust 
version requirement to 1.49, and upstream the fixes as part of our next 
upstreaming period. What do you think about this?

There are a couple more fixes to go from 1.72 to 1.49, and the 
`String::leak` method is also slightly easier to use.

Let me know and I'm happy to reapply the PR.

Best,

Arthur

On 11/23/24 9:09 PM, Thomas Schwinge wrote:
> Hi!
> 
> On 2024-08-01T16:56:01+0200, Arthur Cohen <arthur.cohen@embecosm.com> wrote:
>> Compile libformat_parser and link to it.
> 
>> --- /dev/null
>> +++ b/libgrust/libformat_parser/generic_format_parser/src/lib.rs
>> @@ -0,0 +1,1102 @@
>> +[...]
>> +    let Some(unescaped) = unescape_string(snippet) else {
>> +        return InputStringKind::NotALiteral;
>> +    };
>> +[...]
> 
> OK to push the attached
> "Rust: Work around 'error[E0658]: `let...else` statements are unstable'"?
> Builds and tests fine, but I don't know if this code path is actually
> exercised at this time, so please check carefully; as you know I'm not
> actually a Rust programmer (yet).  ;-)
> 
> 
> Grüße
>   Thomas
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x1B3465B044AD9C65.asc
Type: application/pgp-keys
Size: 3143 bytes
Desc: OpenPGP public key
URL: <https://gcc.gnu.org/pipermail/gcc-rust/attachments/20241125/f9725e12/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://gcc.gnu.org/pipermail/gcc-rust/attachments/20241125/f9725e12/attachment.sig>


More information about the Gcc-rust mailing list