Re: [PATCH v2 1/2] rust: add untrusted data abstraction
From: Benno Lossin
Date: Fri Sep 27 2024 - 05:07:13 EST
On 27.09.24 10:39, Miguel Ojeda wrote:
> On Fri, Sep 27, 2024 at 12:15 AM Benno Lossin <benno.lossin@xxxxxxxxx> wrote:
>>
>> Personally, I would prefer adding a symbol. Since if we allow it, then
>> it might take a long time until the code is removed once we increase the
>> minimum version.
>>
>> It would be best, if it produces an error when we raise the minimum
>> version beyond the one represented by the symbol. Is that already the
>> case?
>
> No -- that is a nice idea that I guess could be implemented in Kconfig
> somewhere (i.e. when checking conditions). However, one of the common
> things to do when upgrading the minimum is to review/clean the
> `*_VERSION` uses anyway (and they may occur outside Kconfig files
> too), and also sometimes one wants to upgrade a minimum without doing
> the cleanups immediately (e.g. the recently proposed GCC 8.1 upgrade).
>
>> Gave it a try and I also can't reproduce the error there...
>
> Hmm... I think CE uses the Rust-provided binaries (and I guess the
> playground too). Do you have a link ("Share" in CE)?
Here you go: https://godbolt.org/z/qE8E9M56c
The error that I get locally:
error: unreachable pattern
--> src/main.rs:8:9
|
8 | Err(e) => match e {},
| ^^^^^^ matches no values because `Infallible` is uninhabited
|
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
note: the lint level is defined here
--> src/main.rs:1:9
|
1 | #![deny(unreachable_patterns)]
| ^^^^^^^^^^^^^^^^^^^^
error: could not compile `rust` (bin "rust") due to 1 previous error
---
Cheers,
Benno